Skip to content

Commit

Permalink
refactor(price): move to script setup (#2952)
Browse files Browse the repository at this point in the history
  • Loading branch information
eiinu authored Mar 8, 2024
1 parent 5f9eab6 commit 8f649cb
Show file tree
Hide file tree
Showing 15 changed files with 284 additions and 259 deletions.
1 change: 1 addition & 0 deletions src/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -1000,6 +1000,7 @@
"cName": "价格",
"type": "component",
"show": true,
"setup": true,
"desc": "价格组件",
"author": "ailululu"
},
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 @@ -30,7 +30,7 @@

<script lang="ts">
import { createComponent } from '@/packages/utils/create';
import NutPrice from '../price/index.taro.vue';
import NutPrice from '../price/index.taro';
import NutTag from '../tag/index.taro.vue';
const { create } = createComponent('card');
export default create({
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 @@ -30,7 +30,7 @@

<script lang="ts">
import { createComponent } from '@/packages/utils/create';
import NutPrice from '../price/index.vue';
import NutPrice from '../price';
import NutTag from '../tag/index.vue';
const { create } = createComponent('card');
export default create({
Expand Down
5 changes: 3 additions & 2 deletions src/packages/__VUE/price/__tests__/price.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { mount } from '@vue/test-utils';
import Price from '../index.vue';
import Price from '../';

test('Price: base price', () => {
const wrapper = mount(Price, {
Expand Down Expand Up @@ -49,7 +49,8 @@ test('Price: symbol props', () => {
test('Price: size props', () => {
const wrapper = mount(Price, {
props: {
size: 'small'
size: 'small',
position: 'after'
}
});
const price: any = wrapper.find('.nut-price');
Expand Down
13 changes: 13 additions & 0 deletions src/packages/__VUE/price/doc.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,19 @@ size: `small`, `normal`, `large`
| size | Size,`small``normal``large` | string | `normal` |
| strike-through`v4.0.3` | strike-through | Boolean | false |

### Types version

The component exports the following type definitions:

```js
import type {
PriceSize,
PricePosition,
PriceProps,
PriceInstance
} from '@nutui/nutui';
```

## Theming

### CSS Variables
Expand Down
13 changes: 13 additions & 0 deletions src/packages/__VUE/price/doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,19 @@ app.use(Price);
| size | 价格尺寸,`small``normal``large` | string | `normal` |
| strike-through`v4.0.3` | 是否展示划线价 | Boolean | false |

### 类型定义 version

组件导出以下类型定义:

```js
import type {
PriceSize,
PricePosition,
PriceProps,
PriceInstance
} from '@nutui/nutui';
```

## 主题定制

### 样式变量
Expand Down
13 changes: 13 additions & 0 deletions src/packages/__VUE/price/doc.taro.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,19 @@ app.use(Price);
| size | 价格尺寸,`small``normal``large` | string | `normal` |
| strike-through`v4.0.3` | 是否展示划线价 | Boolean | false |

### 类型定义 version

组件导出以下类型定义:

```js
import type {
PriceSize,
PricePosition,
PriceProps,
PriceInstance
} from '@nutui/nutui-taro';
```

## 主题定制

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

withInstall(Price);

export type { PriceProps } from './price.taro.vue';

export type { PriceSize, PricePosition } from './types';

export type PriceInstance = ComponentPublicInstance & InstanceType<typeof Price>;

export { Price, Price as default };
131 changes: 0 additions & 131 deletions src/packages/__VUE/price/index.taro.vue

This file was deleted.

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

withInstall(Price);

export type { PriceProps } from './price.vue';

export type { PriceSize, PricePosition } from './types';

export type PriceInstance = ComponentPublicInstance & InstanceType<typeof Price>;

export { Price, Price as default };
122 changes: 0 additions & 122 deletions src/packages/__VUE/price/index.vue

This file was deleted.

Loading

0 comments on commit 8f649cb

Please sign in to comment.