From dbad7571acd0dd1101fe2b385c4079d56b0a2be9 Mon Sep 17 00:00:00 2001 From: neverland Date: Sun, 27 Mar 2022 17:24:50 +0800 Subject: [PATCH] chore: add cdnURL helper (#10439) --- packages/vant/docs/site/use-translate.ts | 4 +++ packages/vant/src/button/demo/index.vue | 4 +-- packages/vant/src/card/demo/index.vue | 4 +-- packages/vant/src/checkbox/demo/index.vue | 11 ++++---- .../vant/src/coupon-list/test/index.spec.ts | 3 ++- packages/vant/src/dialog/demo/index.vue | 4 +-- packages/vant/src/empty/demo/index.vue | 4 +-- packages/vant/src/form/demo/FieldType.vue | 6 ++--- packages/vant/src/grid/demo/index.vue | 17 +++--------- packages/vant/src/icon/demo/index.vue | 4 +-- packages/vant/src/icon/test/index.spec.ts | 3 ++- .../vant/src/image-preview/demo/index.vue | 10 +++---- .../vant/src/image-preview/test/shared.ts | 7 ++--- packages/vant/src/image/demo/index.vue | 4 +-- packages/vant/src/lazyload/demo/index.vue | 20 +++++--------- packages/vant/src/pull-refresh/demo/index.vue | 18 +++++-------- packages/vant/src/radio/demo/index.vue | 7 +++-- packages/vant/src/share-sheet/demo/index.vue | 8 +++--- packages/vant/src/skeleton/demo/index.vue | 4 +-- packages/vant/src/swipe-cell/demo/index.vue | 4 +-- packages/vant/src/swipe/demo/index.vue | 10 +++---- packages/vant/src/tabbar/demo/index.vue | 6 ++--- packages/vant/src/toast/demo/index.vue | 4 +-- packages/vant/src/tree-select/demo/index.vue | 6 ++--- packages/vant/src/uploader/demo/index.vue | 26 ++++++++----------- packages/vant/src/uploader/test/index.spec.ts | 14 +++++----- 26 files changed, 94 insertions(+), 118 deletions(-) diff --git a/packages/vant/docs/site/use-translate.ts b/packages/vant/docs/site/use-translate.ts index 7d29e43d3..38c33dda2 100644 --- a/packages/vant/docs/site/use-translate.ts +++ b/packages/vant/docs/site/use-translate.ts @@ -104,3 +104,7 @@ export function useTranslate(i18n: Record) { return createTranslate(demoName); } + +/** 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/button/demo/index.vue b/packages/vant/src/button/demo/index.vue index 1b328962f..9460e3105 100644 --- a/packages/vant/src/button/demo/index.vue +++ b/packages/vant/src/button/demo/index.vue @@ -1,6 +1,6 @@