From c04369547499b12d2fab03d96d44d66bc60a7214 Mon Sep 17 00:00:00 2001 From: Eiinu Date: Wed, 13 Mar 2024 19:15:59 +0800 Subject: [PATCH] refactor(circle-progress): move to script setup (#2969) --- .../exhibition/pages/circleprogress/color.vue | 2 +- src/config.json | 1 + .../circleprogress/__tests__/index.spec.ts | 2 +- .../circleprogress/circle-progress.taro.vue | 111 +++++++++++++++ .../__VUE/circleprogress/circle-progress.vue | 103 ++++++++++++++ .../__VUE/circleprogress/demo/color.vue | 2 +- .../__VUE/circleprogress/doc.en-US.md | 12 ++ src/packages/__VUE/circleprogress/doc.md | 12 ++ src/packages/__VUE/circleprogress/doc.taro.md | 12 ++ .../__VUE/circleprogress/index.taro.ts | 13 ++ .../__VUE/circleprogress/index.taro.vue | 129 ------------------ src/packages/__VUE/circleprogress/index.ts | 13 ++ src/packages/__VUE/circleprogress/index.vue | 124 ----------------- 13 files changed, 280 insertions(+), 256 deletions(-) create mode 100644 src/packages/__VUE/circleprogress/circle-progress.taro.vue create mode 100644 src/packages/__VUE/circleprogress/circle-progress.vue create mode 100644 src/packages/__VUE/circleprogress/index.taro.ts delete mode 100644 src/packages/__VUE/circleprogress/index.taro.vue create mode 100644 src/packages/__VUE/circleprogress/index.ts delete mode 100644 src/packages/__VUE/circleprogress/index.vue diff --git a/packages/nutui-taro-demo/src/exhibition/pages/circleprogress/color.vue b/packages/nutui-taro-demo/src/exhibition/pages/circleprogress/color.vue index 5af96da47a..b06589b629 100644 --- a/packages/nutui-taro-demo/src/exhibition/pages/circleprogress/color.vue +++ b/packages/nutui-taro-demo/src/exhibition/pages/circleprogress/color.vue @@ -1,6 +1,6 @@ diff --git a/src/config.json b/src/config.json index 23ceb815f1..bfb91decc8 100644 --- a/src/config.json +++ b/src/config.json @@ -608,6 +608,7 @@ "name": "CircleProgress", "cName": "环形进度条", "desc": "用来展示进度", + "setup": true, "author": "Drjingubo" }, { diff --git a/src/packages/__VUE/circleprogress/__tests__/index.spec.ts b/src/packages/__VUE/circleprogress/__tests__/index.spec.ts index 4cc485ae22..ee7c447e9f 100644 --- a/src/packages/__VUE/circleprogress/__tests__/index.spec.ts +++ b/src/packages/__VUE/circleprogress/__tests__/index.spec.ts @@ -1,5 +1,5 @@ import { mount } from '@vue/test-utils'; -import Circleprogress from '../index.vue'; +import Circleprogress from '../'; test('CircleProgress: should change stoke when use width props', async () => { const wrapper = mount(Circleprogress, { diff --git a/src/packages/__VUE/circleprogress/circle-progress.taro.vue b/src/packages/__VUE/circleprogress/circle-progress.taro.vue new file mode 100644 index 0000000000..d8abc2ad7c --- /dev/null +++ b/src/packages/__VUE/circleprogress/circle-progress.taro.vue @@ -0,0 +1,111 @@ + + + diff --git a/src/packages/__VUE/circleprogress/circle-progress.vue b/src/packages/__VUE/circleprogress/circle-progress.vue new file mode 100644 index 0000000000..40e6f2ef37 --- /dev/null +++ b/src/packages/__VUE/circleprogress/circle-progress.vue @@ -0,0 +1,103 @@ + + + diff --git a/src/packages/__VUE/circleprogress/demo/color.vue b/src/packages/__VUE/circleprogress/demo/color.vue index 5af96da47a..b06589b629 100644 --- a/src/packages/__VUE/circleprogress/demo/color.vue +++ b/src/packages/__VUE/circleprogress/demo/color.vue @@ -1,6 +1,6 @@ diff --git a/src/packages/__VUE/circleprogress/doc.en-US.md b/src/packages/__VUE/circleprogress/doc.en-US.md index 6b4150b7dd..85687db070 100644 --- a/src/packages/__VUE/circleprogress/doc.en-US.md +++ b/src/packages/__VUE/circleprogress/doc.en-US.md @@ -58,6 +58,18 @@ app.use(CircleProgress); | --- | --- | | default | Custom Content | +### Types version + +The component exports the following type definitions: + +```js +import type { + CircleProgressStrokeLinecap, + CircleProgressProps, + CircleProgressInstance +} from '@nutui/nutui'; +``` + ## Theming ### CSS Variables diff --git a/src/packages/__VUE/circleprogress/doc.md b/src/packages/__VUE/circleprogress/doc.md index cc2f9c7092..3235afa634 100644 --- a/src/packages/__VUE/circleprogress/doc.md +++ b/src/packages/__VUE/circleprogress/doc.md @@ -58,6 +58,18 @@ app.use(CircleProgress); | --- | --- | | default | 自定义文字内容 | +### 类型定义 version + +组件导出以下类型定义: + +```js +import type { + CircleProgressStrokeLinecap, + CircleProgressProps, + CircleProgressInstance +} from '@nutui/nutui'; +``` + ## 主题定制 ### 样式变量 diff --git a/src/packages/__VUE/circleprogress/doc.taro.md b/src/packages/__VUE/circleprogress/doc.taro.md index fef55adaf8..6bc2d83e23 100644 --- a/src/packages/__VUE/circleprogress/doc.taro.md +++ b/src/packages/__VUE/circleprogress/doc.taro.md @@ -58,6 +58,18 @@ app.use(CircleProgress); | --- | --- | | default | 自定义文字内容 | +### 类型定义 version + +组件导出以下类型定义: + +```js +import type { + CircleProgressStrokeLinecap, + CircleProgressProps, + CircleProgressInstance +} from '@nutui/nutui-taro'; +``` + ## 主题定制 ### 样式变量 diff --git a/src/packages/__VUE/circleprogress/index.taro.ts b/src/packages/__VUE/circleprogress/index.taro.ts new file mode 100644 index 0000000000..59cfd6ccac --- /dev/null +++ b/src/packages/__VUE/circleprogress/index.taro.ts @@ -0,0 +1,13 @@ +import CircleProgress from './circle-progress.taro.vue'; +import type { ComponentPublicInstance } from 'vue'; +import { withInstall } from '@/packages/utils'; + +withInstall(CircleProgress); + +export type { CircleProgressProps } from './circle-progress.taro.vue'; + +export type { CircleProgressStrokeLinecap } from './types'; + +export type CircleProgressInstance = ComponentPublicInstance & InstanceType; + +export { CircleProgress, CircleProgress as default }; diff --git a/src/packages/__VUE/circleprogress/index.taro.vue b/src/packages/__VUE/circleprogress/index.taro.vue deleted file mode 100644 index 72d711ab11..0000000000 --- a/src/packages/__VUE/circleprogress/index.taro.vue +++ /dev/null @@ -1,129 +0,0 @@ - - - diff --git a/src/packages/__VUE/circleprogress/index.ts b/src/packages/__VUE/circleprogress/index.ts new file mode 100644 index 0000000000..b52b8f2115 --- /dev/null +++ b/src/packages/__VUE/circleprogress/index.ts @@ -0,0 +1,13 @@ +import CircleProgress from './circle-progress.vue'; +import type { ComponentPublicInstance } from 'vue'; +import { withInstall } from '@/packages/utils'; + +withInstall(CircleProgress); + +export type { CircleProgressProps } from './circle-progress.vue'; + +export type { CircleProgressStrokeLinecap } from './types'; + +export type CircleProgressInstance = ComponentPublicInstance & InstanceType; + +export { CircleProgress, CircleProgress as default }; diff --git a/src/packages/__VUE/circleprogress/index.vue b/src/packages/__VUE/circleprogress/index.vue deleted file mode 100644 index 74f2f41b43..0000000000 --- a/src/packages/__VUE/circleprogress/index.vue +++ /dev/null @@ -1,124 +0,0 @@ - - -