diff --git a/packages/varlet-ui/src/loading/Loading.vue b/packages/varlet-ui/src/loading/Loading.vue index a461cd6d35c..68827514547 100644 --- a/packages/varlet-ui/src/loading/Loading.vue +++ b/packages/varlet-ui/src/loading/Loading.vue @@ -1,12 +1,12 @@
@@ -46,6 +45,9 @@ import { computed, defineComponent } from 'vue' import { props } from './props' import { toNumber } from '../utils/shared' import type { ComputedRef } from 'vue' +import { createNamespace, call } from '../utils/components' + +const { n, classes } = createNamespace('loading') export default defineComponent({ name: 'VarLoading', @@ -70,12 +72,14 @@ export default defineComponent({ }) const isShow: ComputedRef = computed(() => { - if (!slots.default?.()) return true + if (!call(slots.default)) return true return props.loading }) return { + n, + classes, loadingTypeDict, getRadius, isShow, diff --git a/packages/varlet-ui/src/style-provider/StyleProvider.vue b/packages/varlet-ui/src/style-provider/StyleProvider.vue index 3e0d9709493..16a85e8aec2 100644 --- a/packages/varlet-ui/src/style-provider/StyleProvider.vue +++ b/packages/varlet-ui/src/style-provider/StyleProvider.vue @@ -3,6 +3,9 @@ import { defineComponent, h } from 'vue' import { formatStyleVars } from '../utils/elements' import type { PropType } from 'vue' import type { StyleVars } from './index' +import { call, createNamespace } from '../utils/components' + +const { n } = createNamespace('style-provider') export default defineComponent({ name: 'VarStyleProvider', @@ -17,10 +20,10 @@ export default defineComponent({ h( 'div', { - class: 'var-style-provider', + class: n(), style: formatStyleVars(props.styleVars), }, - slots.default?.() + call(slots.default) ) }, })