diff --git a/packages/vant/docs/site/index.ts b/packages/vant/docs/site/index.ts new file mode 100644 index 000000000..8972e4cdd --- /dev/null +++ b/packages/vant/docs/site/index.ts @@ -0,0 +1,5 @@ +export { useTranslate, initDemoLocale } from './use-translate'; + +/** Generate the CDN URL of assets. */ +export const cdnURL = (path: string) => + `https://cdn.jsdelivr.net/npm/@vant/assets/${path}`; diff --git a/packages/vant/src/action-bar/demo/index.vue b/packages/vant/src/action-bar/demo/index.vue index e500db8ee..eed313bc9 100644 --- a/packages/vant/src/action-bar/demo/index.vue +++ b/packages/vant/src/action-bar/demo/index.vue @@ -2,7 +2,7 @@ import VanActionBar from '..'; import VanActionBarIcon from '../../action-bar-icon'; import VanActionBarButton from '../../action-bar-button'; -import { useTranslate } from '../../../docs/site/use-translate'; +import { useTranslate } from '../../../docs/site'; import { Toast } from '../../toast'; const t = useTranslate({ diff --git a/packages/vant/src/action-sheet/demo/index.vue b/packages/vant/src/action-sheet/demo/index.vue index 89f571698..5af5339b2 100644 --- a/packages/vant/src/action-sheet/demo/index.vue +++ b/packages/vant/src/action-sheet/demo/index.vue @@ -2,7 +2,7 @@ import VanCell from '../../cell'; import VanActionSheet, { ActionSheetAction } from '..'; import { ref, computed } from 'vue'; -import { useTranslate } from '../../../docs/site/use-translate'; +import { useTranslate } from '../../../docs/site'; import { Toast } from '../../toast'; const t = useTranslate({ diff --git a/packages/vant/src/address-edit/demo/index.vue b/packages/vant/src/address-edit/demo/index.vue index 42499a25d..f032b118a 100644 --- a/packages/vant/src/address-edit/demo/index.vue +++ b/packages/vant/src/address-edit/demo/index.vue @@ -2,7 +2,7 @@ import VanAddressEdit from '..'; import { ref } from 'vue'; import { areaList } from '@vant/area-data'; -import { useTranslate } from '../../../docs/site/use-translate'; +import { useTranslate } from '../../../docs/site'; import { Toast } from '../../toast'; const t = useTranslate({ diff --git a/packages/vant/src/address-list/AddressListItem.tsx b/packages/vant/src/address-list/AddressListItem.tsx index 4f89b5d4b..d5d40b602 100644 --- a/packages/vant/src/address-list/AddressListItem.tsx +++ b/packages/vant/src/address-list/AddressListItem.tsx @@ -1,7 +1,12 @@ import { defineComponent, type PropType } from 'vue'; // Utils -import { createNamespace, extend, makeRequiredProp } from '../utils'; +import { + extend, + createNamespace, + makeRequiredProp, + type Numeric, +} from '../utils'; // Components import { Tag } from '../tag'; @@ -12,8 +17,8 @@ import { Radio } from '../radio'; const [name, bem] = createNamespace('address-item'); export type AddressListAddress = { - id: number | string; - tel: number | string; + id: Numeric; + tel: Numeric; name: string; address: string; isDefault?: boolean; diff --git a/packages/vant/src/address-list/demo/index.vue b/packages/vant/src/address-list/demo/index.vue index 2ed2ae7a9..45e5a9f7a 100644 --- a/packages/vant/src/address-list/demo/index.vue +++ b/packages/vant/src/address-list/demo/index.vue @@ -1,7 +1,7 @@