diff --git a/components/statistic/Countdown.tsx b/components/statistic/Countdown.tsx index 3fb37620f..b9f84a1c4 100644 --- a/components/statistic/Countdown.tsx +++ b/components/statistic/Countdown.tsx @@ -16,7 +16,7 @@ export default defineComponent({ format: 'HH:mm:ss', }), emits: ['finish', 'change'], - setup(props, { emit }) { + setup(props, { emit, slots }) { const countdownId = ref(); const statistic = ref(); const syncTimer = () => { @@ -84,6 +84,7 @@ export default defineComponent({ valueRender: valueRenderHtml, formatter: formatCountdown, }} + v-slots={slots} /> ); }; diff --git a/components/statistic/demo/countdown-slot.vue b/components/statistic/demo/countdown-slot.vue new file mode 100644 index 000000000..fec5ca052 --- /dev/null +++ b/components/statistic/demo/countdown-slot.vue @@ -0,0 +1,68 @@ + +--- +order: 4 +title: + zh-CN: 倒计时组件 + en-US: Countdown +--- + +## zh-CN + +倒计时组件使用插槽。 + +## en-US + +Countdown component slots. + + + + + diff --git a/components/statistic/demo/index.vue b/components/statistic/demo/index.vue index e79ab9d6a..a395ac713 100644 --- a/components/statistic/demo/index.vue +++ b/components/statistic/demo/index.vue @@ -4,6 +4,7 @@ +