Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Programattically Update Global Configuration #20397

Closed
angrymarker opened this issue Aug 26, 2024 · 1 comment
Closed

[Feature Request] Programattically Update Global Configuration #20397

angrymarker opened this issue Aug 26, 2024 · 1 comment

Comments

@angrymarker
Copy link

Problem to solve

I would like to be able to update the default table height value based on the display - height value. I have a default value of 275 set, but would love to apply more logic to have a larger (or smaller) table height based on display

Proposed solution

Utilize UseDefaults to update values provided
plugins/vuetify.js

export default createVuetify({
  defaults: {
    VTable: {
      height: 275,
      density: 'compact',
      fixedHeader: true
    },
  }
})

Home.vue:

<script setup>
import { useDefaults, useDisplay} from 'vuetify'
import {onMounted} from 'vue'
const defaults = useDefaults()
const { height } = useDisplay()
onMounted(()=>{
  defaults.defaults.VTable.height = height.value - 270
})
</script>
@KaelWD
Copy link
Member

KaelWD commented Aug 26, 2024

Use https://vuetifyjs.com/en/components/defaults-providers/ if you need dynamic props.

@KaelWD KaelWD closed this as not planned Won't fix, can't repro, duplicate, stale Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants