From dd4efa8cfdca28e2ac39a82ad02d2123b34a2518 Mon Sep 17 00:00:00 2001 From: haoziqaq <357229046@qq.com> Date: Tue, 9 Mar 2021 11:51:55 +0800 Subject: [PATCH] =?UTF-8?q?fix(ui/popup):=20=E9=87=8D=E5=86=99example?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit affects: @varlet/cli, @varlet/ui --- .../src/compiler/compileTemplateHighlight.ts | 12 +- packages/varlet-ui/src/button/button.less | 1 + packages/varlet-ui/src/button/docs/en-US.md | 2 +- packages/varlet-ui/src/popup/Popup.vue | 66 ++--- .../varlet-ui/src/popup/example/index.vue | 256 ++++++------------ packages/varlet-ui/src/popup/props.ts | 8 - packages/varlet-ui/src/ripple/docs/en-US.md | 3 + packages/varlet-ui/src/ripple/docs/zh-CN.md | 3 + packages/varlet-ui/src/skeleton/docs/en-US.md | 15 +- packages/varlet-ui/src/skeleton/docs/zh-CN.md | 9 + packages/varlet-ui/src/snackbar/Snackbar.vue | 26 +- packages/varlet-ui/src/utils/components.ts | 18 ++ packages/varlet-ui/src/utils/teleport.ts | 17 -- 13 files changed, 178 insertions(+), 258 deletions(-) delete mode 100644 packages/varlet-ui/src/utils/teleport.ts diff --git a/packages/varlet-cli/src/compiler/compileTemplateHighlight.ts b/packages/varlet-cli/src/compiler/compileTemplateHighlight.ts index a6d0b6fa18a..442cf13c58d 100644 --- a/packages/varlet-cli/src/compiler/compileTemplateHighlight.ts +++ b/packages/varlet-cli/src/compiler/compileTemplateHighlight.ts @@ -60,7 +60,7 @@ export function compileTable(md: string, titleRe: RegExp): string { export function compileTags(table: Record, tags: Record, componentName: string) { tags[componentName] = { - attributes: table.attributesTable.map((row: any) => row[0]), + attributes: table.attributesTable.map((row: any) => row[0].replace(/`/g, '')), } } @@ -69,7 +69,7 @@ export function compileAttributes(table: Record, attributes: Record const attrNamespace = `${get(varletConfig, 'namespace')}-${componentName}/${row[0]}` attributes[attrNamespace] = { type: row[2].replace(/_/g, ''), - description: `${row[1]} 默认值:${row[3]}`, + description: `${row[1]} 默认值:${row[3].replace(/`/g, '')}`, } }) } @@ -78,9 +78,9 @@ export function compileWebTypes(table: Record, webTypes: Record ({ - name: row[0], + name: row[0].replace(/`/g, ''), description: row[1], - default: row[3], + default: row[3].replace(/`/g, ''), value: { type: row[2].replace(/_/g, ''), kind: 'expression', @@ -88,12 +88,12 @@ export function compileWebTypes(table: Record, webTypes: Record ({ - name: row[0], + name: row[0].replace(/`/g, ''), description: row[1], })) const slots = slotsTable.map((row: any) => ({ - name: row[0], + name: row[0].replace(/`/g, ''), description: row[1], })) diff --git a/packages/varlet-ui/src/button/button.less b/packages/varlet-ui/src/button/button.less index fdd9c6b8330..8db2f0402b7 100644 --- a/packages/varlet-ui/src/button/button.less +++ b/packages/varlet-ui/src/button/button.less @@ -33,6 +33,7 @@ will-change: box-shadow; transition: 0.3s cubic-bezier(0.25, 0.8, 0.5, 1); cursor: pointer; + font-family: inherit; &:active { box-shadow: 0 3px 3px -2px @shadow-key-umbra-opacity, 0 3px 4px 0 @shadow-key-penumbra-opacity, diff --git a/packages/varlet-ui/src/button/docs/en-US.md b/packages/varlet-ui/src/button/docs/en-US.md index 964c88f8fa9..262394cdceb 100644 --- a/packages/varlet-ui/src/button/docs/en-US.md +++ b/packages/varlet-ui/src/button/docs/en-US.md @@ -156,7 +156,7 @@ export default { ### Theme Variables #### The following LESS variables can be overridden at build time to modify the theme style -| 变量名 | 默认值 | +| Variable | Default | | --- | --- | | `@button-default-color` | `#f5f5f5` | | `@button-primary-color` | `@color-primary` | diff --git a/packages/varlet-ui/src/popup/Popup.vue b/packages/varlet-ui/src/popup/Popup.vue index 285633cffc0..1bf93832a7a 100644 --- a/packages/varlet-ui/src/popup/Popup.vue +++ b/packages/varlet-ui/src/popup/Popup.vue @@ -1,18 +1,12 @@