diff --git a/src/_base/fade-in-expand-transition/src/FadeInExpandTransition.js b/src/_base/fade-in-expand-transition/src/FadeInExpandTransition.js index b93443eb4..825ec0087 100644 --- a/src/_base/fade-in-expand-transition/src/FadeInExpandTransition.js +++ b/src/_base/fade-in-expand-transition/src/FadeInExpandTransition.js @@ -1,6 +1,6 @@ -import { h, Transition, TransitionGroup } from 'vue' +import { h, Transition, TransitionGroup, defineComponent } from 'vue' -export default { +export default defineComponent({ name: 'FadeInExpandTransition', props: { appear: { @@ -96,4 +96,4 @@ export default { } ) } -} +}) diff --git a/src/_base/focus-detector/src/FocusDetector.vue b/src/_base/focus-detector/src/FocusDetector.vue index bc8b6da72..88f8299ce 100644 --- a/src/_base/focus-detector/src/FocusDetector.vue +++ b/src/_base/focus-detector/src/FocusDetector.vue @@ -8,7 +8,9 @@ diff --git a/src/_base/icon-switch-transition/src/IconSwitchTransition.js b/src/_base/icon-switch-transition/src/IconSwitchTransition.js index f72d69584..fc2c0f9c1 100644 --- a/src/_base/icon-switch-transition/src/IconSwitchTransition.js +++ b/src/_base/icon-switch-transition/src/IconSwitchTransition.js @@ -1,6 +1,6 @@ -import { h, nextTick, Transition } from 'vue' +import { h, nextTick, Transition, defineComponent } from 'vue' -export default { +export default defineComponent({ name: 'NBaseIconSwitchTransition', data () { return { @@ -22,4 +22,4 @@ export default { this.$slots ) } -} +}) diff --git a/src/_base/loading/src/Loading.vue b/src/_base/loading/src/Loading.vue index 2366e6a31..88814d72d 100644 --- a/src/_base/loading/src/Loading.vue +++ b/src/_base/loading/src/Loading.vue @@ -1,6 +1,5 @@ diff --git a/src/_base/wave/src/styles/base.cssr.js b/src/_base/wave/src/styles/base.cssr.js deleted file mode 100644 index b49044ac8..000000000 --- a/src/_base/wave/src/styles/base.cssr.js +++ /dev/null @@ -1,14 +0,0 @@ -import { cB, c } from '../../../../_utils/cssr/index.js' - -export default c([ - () => cB('base-wave', { - raw: ` - position: absolute; - left: 0; - right: 0; - top: 0; - bottom: 0; - border-radius: inherit; - ` - }) -]) diff --git a/src/_base/wave/src/styles/index.cssr.js b/src/_base/wave/src/styles/index.cssr.js new file mode 100644 index 000000000..4577d39bc --- /dev/null +++ b/src/_base/wave/src/styles/index.cssr.js @@ -0,0 +1,10 @@ +import { cB } from '../../../../_utils/cssr/index.js' + +export default cB('base-wave', ` + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + border-radius: inherit; +`) diff --git a/src/_base/wave/src/styles/index.js b/src/_base/wave/src/styles/index.js deleted file mode 100644 index f31470811..000000000 --- a/src/_base/wave/src/styles/index.js +++ /dev/null @@ -1,9 +0,0 @@ -import baseStyle from './base.cssr.js' - -export default [ - { - key: 'theme', - watch: ['theme'], - CNode: baseStyle - } -] diff --git a/src/_base/wave/styles/dark.js b/src/_base/wave/styles/dark.js deleted file mode 100644 index ead5a736d..000000000 --- a/src/_base/wave/styles/dark.js +++ /dev/null @@ -1,9 +0,0 @@ -import create from '../../../_styles/utils/create-component-base' - -export default create({ - name: 'BaseWave', - theme: 'dark', - getLocalVars () { - return {} - } -}) diff --git a/src/_base/wave/styles/index.js b/src/_base/wave/styles/index.js deleted file mode 100644 index 6b73259c5..000000000 --- a/src/_base/wave/styles/index.js +++ /dev/null @@ -1,2 +0,0 @@ -export { default as baseWaveLight } from './light' -export { default as baseWaveDark } from './dark' diff --git a/src/_base/wave/styles/light.js b/src/_base/wave/styles/light.js deleted file mode 100644 index ddbb409b9..000000000 --- a/src/_base/wave/styles/light.js +++ /dev/null @@ -1,9 +0,0 @@ -import create from '../../../_styles/utils/create-component-base' - -export default create({ - name: 'BaseWave', - theme: 'light', - getLocalVars () { - return {} - } -}) diff --git a/src/_mixins/index.js b/src/_mixins/index.js index f3a0f5616..958a7eb5a 100644 --- a/src/_mixins/index.js +++ b/src/_mixins/index.js @@ -8,3 +8,4 @@ export { default as useFormItem } from './use-form-item' export { default as useTheme } from './use-theme' export { default as useConfig } from './use-config' export { default as useLocale } from './use-locale' +export { default as useStyle } from './use-style' diff --git a/src/_mixins/use-style.js b/src/_mixins/use-style.js new file mode 100644 index 000000000..1771371fa --- /dev/null +++ b/src/_mixins/use-style.js @@ -0,0 +1,9 @@ +import { onBeforeMount } from 'vue' + +export default function useStyle (mountId, style) { + onBeforeMount(() => { + style.mount({ + id: mountId + }) + }) +} diff --git a/src/badge/styles/dark.js b/src/badge/styles/dark.js index 059c22751..d76c83417 100644 --- a/src/badge/styles/dark.js +++ b/src/badge/styles/dark.js @@ -1,11 +1,11 @@ -import { baseDark } from '../../_styles/base' import { baseSlotMachineDark } from '../../_base/slot-machine/styles' -import { baseWaveDark } from '../../_base/wave/styles' import { commonDark } from '../../_styles/new-common' export default { common: commonDark, - peers: [baseDark, baseWaveDark, baseSlotMachineDark], + peers: { + BaseSlotMachine: baseSlotMachineDark + }, self (vars) { const { errorColorSuppl, diff --git a/src/badge/styles/light.js b/src/badge/styles/light.js index 8438d4b3b..a0bb922cd 100644 --- a/src/badge/styles/light.js +++ b/src/badge/styles/light.js @@ -1,11 +1,11 @@ -import { baseLight } from '../../_styles/base' import { baseSlotMachineLight } from '../../_base/slot-machine/styles' -import { baseWaveLight } from '../../_base/wave/styles' import { commonLight } from '../../_styles/new-common' export default { common: commonLight, - peers: [baseLight, baseWaveLight, baseSlotMachineLight], + peers: { + BaseSlotMachine: baseSlotMachineLight + }, self (vars) { const { errorColor, infoColor, successColor, warningColor } = vars return { diff --git a/src/cascader/styles/light.js b/src/cascader/styles/light.js index d85963390..9a1598e03 100644 --- a/src/cascader/styles/light.js +++ b/src/cascader/styles/light.js @@ -1,5 +1,4 @@ import { baseMenuMaskLight } from '../../_base/menu-mask/styles' -import { baseLoadingLight } from '../../_base/loading/styles' import { baseSelectionLight } from '../../_base/selection/styles' import { baseSelectMenuLight } from '../../_base/select-menu/styles' import { scrollbarLight } from '../../scrollbar/styles' @@ -12,7 +11,6 @@ export default { BaseMenuMask: baseMenuMaskLight, BaseSelectMenu: baseSelectMenuLight, BaseSelection: baseSelectionLight, - BaseLoading: baseLoadingLight, Scrollbar: scrollbarLight, Checkbox: checkboxLight }, diff --git a/src/log/styles/light.js b/src/log/styles/light.js index 56ed46bd4..007419be1 100644 --- a/src/log/styles/light.js +++ b/src/log/styles/light.js @@ -1,4 +1,3 @@ -import { baseLoadingLight } from '../../_base/loading/styles' import { scrollbarLight } from '../../scrollbar/styles' import { commonLight } from '../../_styles/new-common' import { codeLight } from '../../code/styles' @@ -7,7 +6,6 @@ export default { name: 'Log', common: commonLight, peers: { - BaseLoading: baseLoadingLight, Scrollbar: scrollbarLight, Code: codeLight }, diff --git a/src/spin/styles/light.js b/src/spin/styles/light.js index 954b0ba07..1a771c5e0 100644 --- a/src/spin/styles/light.js +++ b/src/spin/styles/light.js @@ -1,12 +1,8 @@ -import { baseLoadingLight } from '../../_base/loading/styles' import { commonLight } from '../../_styles/new-common' export default { name: 'Spin', common: commonLight, - peers: { - BaseLoading: baseLoadingLight - }, self (vars) { const { opacityDisabled, diff --git a/src/styles.js b/src/styles.js index 98a6aabad..9d9f37c98 100644 --- a/src/styles.js +++ b/src/styles.js @@ -3,7 +3,7 @@ export { baseClearButtonDark, baseClearButtonLight } from './_base/clear-button/styles' -export { baseLoadingDark, baseLoadingLight } from './_base/loading/styles' +// export { baseLoadingDark, baseLoadingLight } from './_base/loading/styles' export { baseMenuMaskDark, baseMenuMaskLight } from './_base/menu-mask/styles' export { baseSelectionDark, baseSelectionLight } from './_base/selection/styles' export { @@ -14,7 +14,7 @@ export { baseSlotMachineDark, baseSlotMachineLight } from './_base/slot-machine/styles' -export { baseWaveDark, baseWaveLight } from './_base/wave/styles' +// export { baseWaveDark, baseWaveLight } from './_base/wave/styles' // exposed style export { baseDark, baseLight } from './_styles/base' // export { affixDark, affixLight } from './affix/styles' diff --git a/src/tree/styles/light.js b/src/tree/styles/light.js index fb866b6c5..24d1ee1ab 100644 --- a/src/tree/styles/light.js +++ b/src/tree/styles/light.js @@ -1,7 +1,6 @@ import { changeColor } from 'seemly' import { iconLight } from '../../icon/styles' import { checkboxLight } from '../../checkbox/styles' -import { baseLoadingLight } from '../../_base/loading/styles' import { commonLight } from '../../_styles/new-common' export default { @@ -9,8 +8,7 @@ export default { common: commonLight, peers: { Icon: iconLight, - Checkbox: checkboxLight, - BaseLoading: baseLoadingLight + Checkbox: checkboxLight }, self (vars) { const {