Skip to content

Commit

Permalink
refactor(invoice): move to script setup (jd-opensource#2981)
Browse files Browse the repository at this point in the history
  • Loading branch information
eiinu authored Mar 19, 2024
1 parent cb45fde commit 7991c38
Show file tree
Hide file tree
Showing 13 changed files with 229 additions and 258 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
</template>
<script setup lang="ts">
import { ref, reactive } from 'vue';
import type { InvoiceDataItem } from '@nutui/nutui-taro';
const asyncValidator = (val: string) => {
return new Promise((resolve) => {
setTimeout(() => {
Expand All @@ -11,7 +12,7 @@ const asyncValidator = (val: string) => {
});
};
const data = ref([
const data = ref<InvoiceDataItem[]>([
{
type: 'radio',
label: '发票类型',
Expand Down
1 change: 1 addition & 0 deletions src/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,7 @@
"cType": "特色组件",
"cName": "发票",
"desc": "发票",
"setup": true,
"author": "ailululu"
},
{
Expand Down
3 changes: 2 additions & 1 deletion src/packages/__VUE/invoice/demo/basic.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
</template>
<script setup lang="ts">
import { ref, reactive } from 'vue';
import type { InvoiceDataItem } from '../types';
const asyncValidator = (val: string) => {
return new Promise((resolve) => {
setTimeout(() => {
Expand All @@ -11,7 +12,7 @@ const asyncValidator = (val: string) => {
});
};
const data = ref([
const data = ref<InvoiceDataItem[]>([
{
type: 'radio',
label: '发票类型',
Expand Down
15 changes: 13 additions & 2 deletions src/packages/__VUE/invoice/doc.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,19 @@ The optional attributes are as follows:

| Event | Description | Arguments |
| --- | --- | --- |
| submit`v4.1.5` | Method of submitting form for verification | Promise |
| on-submit | Method of submitting form for verification | Promise |
| submit | Method of submitting form for verification | Promise |

### Types version

The component exports the following type definitions:

```js
import type {
InvoiceDataItem,
InvoiceProps,
InvoiceInstance
} from '@nutui/nutui';
```

## Theming

Expand Down
15 changes: 13 additions & 2 deletions src/packages/__VUE/invoice/doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,19 @@ app.use(Invoice);

| 事件名 | 说明 | 参数 | 返回值 |
| --- | --- | --- | --- |
| submit`v4.1.5` | 提交表单的方法 | - | Promise |
| on-submit | 提交表单的方法 | - | Promise |
| submit | 提交表单的方法 | - | Promise |

### 类型定义 version

组件导出以下类型定义:

```js
import type {
InvoiceDataItem,
InvoiceProps,
InvoiceInstance
} from '@nutui/nutui';
```

## 主题定制

Expand Down
15 changes: 13 additions & 2 deletions src/packages/__VUE/invoice/doc.taro.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,19 @@ app.use(Invoice);

| 事件名 | 说明 | 参数 | 返回值 |
| --- | --- | --- | --- |
| submit`v4.1.5` | 提交表单的方法 | - | Promise |
| on-submit | 提交表单的方法 | - | Promise |
| submit | 提交表单的方法 | - | Promise |

### 类型定义 version

组件导出以下类型定义:

```js
import type {
InvoiceDataItem,
InvoiceProps,
InvoiceInstance
} from '@nutui/nutui-taro';
```

## 主题定制

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

withInstall(Invoice);

export type { InvoiceProps } from './invoice.taro.vue';

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

export type InvoiceInstance = ComponentPublicInstance & InstanceType<typeof Invoice>;

export { Invoice, Invoice as default };
123 changes: 0 additions & 123 deletions src/packages/__VUE/invoice/index.taro.vue

This file was deleted.

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

withInstall(Invoice);

export type { InvoiceProps } from './invoice.vue';

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

export type InvoiceInstance = ComponentPublicInstance & InstanceType<typeof Invoice>;

export { Invoice, Invoice as default };
123 changes: 0 additions & 123 deletions src/packages/__VUE/invoice/index.vue

This file was deleted.

Loading

0 comments on commit 7991c38

Please sign in to comment.