mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-02-01 12:47:57 +01:00
chore(Icon): use computed for dynamic prop
This commit is contained in:
@@ -4,9 +4,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent } from 'vue'
|
import { defineComponent, computed } from 'vue'
|
||||||
// @ts-expect-error
|
import { useAppConfig } from '#imports'
|
||||||
import appConfig from '#build/app.config'
|
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
props: {
|
props: {
|
||||||
@@ -16,7 +15,18 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
dynamic: {
|
dynamic: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: () => !!appConfig.ui?.icons?.dynamic
|
default: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
setup (props) {
|
||||||
|
const appConfig = useAppConfig()
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
|
const dynamic = computed(() => props.dynamic || appConfig.ui?.icons?.dynamic)
|
||||||
|
|
||||||
|
return {
|
||||||
|
// eslint-disable-next-line vue/no-dupe-keys
|
||||||
|
dynamic
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user