Skip to content

Commit

Permalink
refactor(tag): move to script setup (jd-opensource#2978)
Browse files Browse the repository at this point in the history
  • Loading branch information
subordon authored Mar 19, 2024
1 parent 29db146 commit 36877ff
Show file tree
Hide file tree
Showing 14 changed files with 204 additions and 203 deletions.
1 change: 1 addition & 0 deletions src/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,7 @@
"version": "3.0.0",
"name": "Tag",
"cName": "标签",
"setup": true,
"desc": "标签",
"author": "liqiong"
},
Expand Down
2 changes: 1 addition & 1 deletion src/packages/__VUE/backtop/doc.taro.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ app.use(Backtop);
组件导出以下类型定义:

```ts
import type { BacktopProps, BacktopInstance } from '@nutui/nutui';
import type { BacktopProps, BacktopInstance } from '@nutui/nutui-taro';
```

## 主题定制
Expand Down
2 changes: 1 addition & 1 deletion src/packages/__VUE/card/index.taro.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<script lang="ts">
import { createComponent } from '@/packages/utils/create';
import NutPrice from '../price/index.taro';
import NutTag from '../tag/index.taro.vue';
import NutTag from '../tag/index.taro';
const { create } = createComponent('card');
export default create({
components: {
Expand Down
2 changes: 1 addition & 1 deletion src/packages/__VUE/card/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<script lang="ts">
import { createComponent } from '@/packages/utils/create';
import NutPrice from '../price';
import NutTag from '../tag/index.vue';
import NutTag from '../tag';
const { create } = createComponent('card');
export default create({
components: {
Expand Down
10 changes: 9 additions & 1 deletion src/packages/__VUE/tag/doc.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ app.use(Tag);

| Attribute | Description | Type | Default |
| --- | --- | --- | --- |
| type | Label type,can be set `primary` `success` `danger` `warning` | string | `default` |
| type | Label type,can be set `primary` `success` `danger` `warning``default` | string | `default` |
| color | Label color | string | - |
| text-color | Text color, which takes precedence over the `color` attribute | string | `white` |
| plain | Whether it is plain | boolean | `false` |
Expand All @@ -53,6 +53,14 @@ app.use(Tag);
| click | click event | `event` |
| close | close event | `event` |

### Types version

The component exports the following type definitions:

```js
import type { TagType, TagProps, TagInstance } from '@nutui/nutui';
```

## Theming

### CSS Variables
Expand Down
10 changes: 9 additions & 1 deletion src/packages/__VUE/tag/doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ app.use(Tag);

| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| type | 标签类型,可选值为 `primary``success``danger``warning` | string | `default` |
| type | 标签类型,可选值为 `primary``success``danger``warning``default` | string | `default` |
| color | 标签颜色 | string | - |
| text-color | 文本颜色,优先级高于 `color` 属性 | string | `white` |
| plain | 是否为空心样式 | boolean | `false` |
Expand All @@ -53,6 +53,14 @@ app.use(Tag);
| click | 点击事件 | `event` |
| close | 关闭事件 | `event` |

### 类型定义 version

组件导出以下类型定义:

```js
import type { TagType, TagProps, TagInstance } from '@nutui/nutui';
```

## 主题定制

### 样式变量
Expand Down
10 changes: 9 additions & 1 deletion src/packages/__VUE/tag/doc.taro.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ app.use(Tag);

| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| type | 标签类型,可选值为 `primary``success``danger``warning` | string | `default` |
| type | 标签类型,可选值为 `primary``success``danger``warning``default` | string | `default` |
| color | 标签颜色 | string | - |
| text-color | 文本颜色,优先级高于 `color` 属性 | string | `white` |
| plain | 是否为空心样式 | boolean | `false` |
Expand All @@ -53,6 +53,14 @@ app.use(Tag);
| click | 点击事件 | `event` |
| close | 关闭事件 | `event` |

### 类型定义 version

组件导出以下类型定义:

```js
import type { TagType, TagProps, TagInstance } from '@nutui/nutui-taro';
```

## 主题定制

### 样式变量
Expand Down
13 changes: 13 additions & 0 deletions src/packages/__VUE/tag/index.taro.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import Tag from './tag.taro.vue';
import type { ComponentPublicInstance } from 'vue';
import { withInstall } from '@/packages/utils';

withInstall(Tag);

export type { TagProps } from './tag.taro.vue';

export type { TagType } from './types';

export type TagInstance = ComponentPublicInstance & InstanceType<typeof Tag>;

export { Tag, Tag as default };
98 changes: 0 additions & 98 deletions src/packages/__VUE/tag/index.taro.vue

This file was deleted.

13 changes: 13 additions & 0 deletions src/packages/__VUE/tag/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import Tag from './tag.vue';
import type { ComponentPublicInstance } from 'vue';
import { withInstall } from '@/packages/utils';

withInstall(Tag);

export type { TagProps } from './tag.vue';

export type { TagType } from './types';

export type TagInstance = ComponentPublicInstance & InstanceType<typeof Tag>;

export { Tag, Tag as default };
98 changes: 0 additions & 98 deletions src/packages/__VUE/tag/index.vue

This file was deleted.

Loading

0 comments on commit 36877ff

Please sign in to comment.