diff --git a/docs/ExamplesDocsApp.vue b/docs/ExamplesDocsApp.vue index 454ec1d6c..1e1a9133e 100644 --- a/docs/ExamplesDocsApp.vue +++ b/docs/ExamplesDocsApp.vue @@ -58,12 +58,6 @@ export default { } } } - - p { - font-size: 14px; - color: #5e6d82; - margin: 14px 0; - } } .page-content { @@ -72,6 +66,12 @@ export default { height: inherit; margin-left: 320px; padding: 0 20px; + + section > p { + font-size: 14px; + color: #5e6d82; + margin: 14px 0; + } } .demo-page { diff --git a/docs/components/demo-block.vue b/docs/components/demo-block.vue index b32daf996..44354dbf3 100644 --- a/docs/components/demo-block.vue +++ b/docs/components/demo-block.vue @@ -44,6 +44,7 @@ export default { padding: 20px 0; min-height: 200px; max-height: 600px; + overflow: auto; } .highlight { diff --git a/docs/examples-docs/card.md b/docs/examples-docs/card.md index 2e173c6a1..5220232bc 100644 --- a/docs/examples-docs/card.md +++ b/docs/examples-docs/card.md @@ -4,19 +4,21 @@ 当没有底部按钮时,右侧内容会居中显示。 +:::demo ```html - ``` +::: ### 高级用法 可以使用具名`slot`重写标题等信息,其中包含`title`、`desc`、`footer`和`tag`四个`slot`。 +:::demo ```html ``` +::: ### API diff --git a/docs/examples-docs/cell.md b/docs/examples-docs/cell.md index c18178a2b..4ca79030f 100644 --- a/docs/examples-docs/cell.md +++ b/docs/examples-docs/cell.md @@ -20,50 +20,59 @@ export default { ### 基础用法 +:::demo ```html ``` +::: ### 标题带描述信息 传入`label`属性,属性值为描述信息的值。 +:::demo ```html ``` +::: ### 带图标 传入`icon`属性。 +:::demo ```html ``` +::: ### 可点击的链接 传入`url`属性,传入`isLink`属性则会在右侧显示箭头。 +:::demo ```html ``` +::: ### 高级用法 如以上用法不能满足你的需求,可以使用对应的`slot`来自定义显示的内容。包含三个`slot`,默认`slot`,`icon`和`title`的`slot`。 +:::demo ```html @@ -75,6 +84,7 @@ export default { ``` +::: ### API diff --git a/docs/examples-docs/checkbox.md b/docs/examples-docs/checkbox.md index ce1ca634e..c8cabae7e 100644 --- a/docs/examples-docs/checkbox.md +++ b/docs/examples-docs/checkbox.md @@ -1,9 +1,49 @@ + + + + ## Checkbox组件 ### 基础用法 +:::demo ```html -复选框1 +
+ 复选框1 +
``` +::: ### 禁用状态 +:::demo ```html -复选框2 +
+ 复选框2 +
``` +::: ### Checkbox组 +:::demo ```html - - 复选框{{item}} - +
+ + 复选框{{item}} + +
``` +::: ### 禁用Checkbox组 +:::demo ```html - - 复选框{{item}} - +
+ + 复选框{{item}} + +
``` +::: ### 与Cell组件一起使用 +:::demo ```html @@ -110,6 +164,7 @@ export default { }; ``` +::: ### Checkbox API diff --git a/docs/examples-docs/dialog.md b/docs/examples-docs/dialog.md index 53c8de4a4..da4a96912 100644 --- a/docs/examples-docs/dialog.md +++ b/docs/examples-docs/dialog.md @@ -30,6 +30,7 @@ export default { ### 基础用法 +:::demo ```html alert @@ -63,6 +64,7 @@ export default { }; ``` +::: ### API diff --git a/docs/examples-docs/field.md b/docs/examples-docs/field.md index c9f572471..8516c48a2 100644 --- a/docs/examples-docs/field.md +++ b/docs/examples-docs/field.md @@ -6,6 +6,7 @@ 根据`type`属性显示不同的输入框。 +:::demo ```html @@ -13,26 +14,31 @@ ``` +::: ### 无label的输入框 不传入`label`属性即可。 +:::demo ```html ``` +::: ### 监听change事件 监听组件的`change`事件。 +:::demo ```html ``` +::: ### API diff --git a/docs/examples-docs/install.md b/docs/examples-docs/install.md index b43a4fc73..a88c3b88d 100644 --- a/docs/examples-docs/install.md +++ b/docs/examples-docs/install.md @@ -2,6 +2,6 @@ ### ynpm安装 -``` +```shell npm i @youzan/zanui-vue -S ``` diff --git a/docs/examples-docs/loading.md b/docs/examples-docs/loading.md index d5b9c2af0..46aabee91 100644 --- a/docs/examples-docs/loading.md +++ b/docs/examples-docs/loading.md @@ -1,33 +1,5 @@ -l## Switch组件 - -### 基础用法 - -```html - - - \ No newline at end of file + + +## Loading + +### 基础用法 + +:::demo +```html +
+

渐变深色spinner

+
+ +
+

渐变浅色spinner

+
+ +
+

单色spinner

+
+ +
+

单色spinner

+
+ +
+
+``` +::: diff --git a/docs/examples-docs/panel.md b/docs/examples-docs/panel.md index 947509b44..f33211c0c 100644 --- a/docs/examples-docs/panel.md +++ b/docs/examples-docs/panel.md @@ -1,38 +1,55 @@ + + ## Panel 面板 面板只是一个容器,里面可以放入自定义的内容。 ### 基础用法 +:::demo ```html - -
-

商品名称是什么,两行显示状态如效果图,多余多余多余两行显示状态如效果图,多余多余多余两行显示状态如效果图,多余多余多余两行显示状态如效果图,多余多余多余两行显示状态如效果图,多余多余多余

- ¥ 2.00 -
-
-

商品sku

- x 2 -
- -
-
- 合计:¥ 1999.90 +
+ panel内容
``` +::: ### 高级用法 使用具名`slot`自定义内容。 +:::demo ```html ``` +::: ### API diff --git a/docs/examples-docs/picker.md b/docs/examples-docs/picker.md index e635b8492..2fcac8901 100644 --- a/docs/examples-docs/picker.md +++ b/docs/examples-docs/picker.md @@ -1,12 +1,45 @@ + + ## Picker组件 模仿iOS中的`UIPickerView`。 ### 基础用法 +:::demo ```html ``` +::: ### API diff --git a/docs/examples-docs/popup.md b/docs/examples-docs/popup.md index 110ba3150..f28fe762d 100644 --- a/docs/examples-docs/popup.md +++ b/docs/examples-docs/popup.md @@ -2,6 +2,7 @@ ### 基础用法 +:::demo ```html
从下方弹出popup @@ -54,6 +55,7 @@ export default { }; ``` +::: ### API diff --git a/docs/examples-docs/quickstart.md b/docs/examples-docs/quickstart.md index 2a83a5fea..7f30110ab 100644 --- a/docs/examples-docs/quickstart.md +++ b/docs/examples-docs/quickstart.md @@ -2,7 +2,7 @@ ### 完整引入 -``` +```js import Vue from 'vue'; import ZanUI from '@youzan/zanui-vue'; import '@youzan/zanui-vue/lib/zanui-css/index.css'; @@ -12,7 +12,7 @@ Vue.use(ZanUI); ### 按需引入 -``` +```js import Vue from 'vue'; import { Button, Cell } from '@youzan/zanui-vue'; import '@youzan/zanui-vue/lib/zanui-css/button.css'; diff --git a/docs/examples-docs/radio.md b/docs/examples-docs/radio.md index 433894a26..92e66068b 100644 --- a/docs/examples-docs/radio.md +++ b/docs/examples-docs/radio.md @@ -1,8 +1,25 @@ + + ``` +::: ### 禁用状态 +:::demo ```html -未选中禁用 -选中且禁用 +
+ 未选中禁用 + 选中且禁用 +
``` +::: ### radio组 +:::demo ```html - - 单选框1 - 单选框2 - - +
+ + 单选框1 + 单选框2 + +
+ ``` +::: ### 与Cell组件一起使用 +:::demo ```html @@ -83,6 +113,7 @@ export default { }; ``` +::: ### Radio API diff --git a/docs/examples-docs/search.md b/docs/examples-docs/search.md index 644bfb416..af2d6505e 100644 --- a/docs/examples-docs/search.md +++ b/docs/examples-docs/search.md @@ -1,17 +1,4 @@ -## Search 组件 - -### 基础用法 - - -```html - - -``` - -```javascript + + +## Search 组件 + +### 基础用法 + +:::demo +```html + + ``` +::: ### API diff --git a/docs/examples-docs/steps.md b/docs/examples-docs/steps.md index ed483a012..255cae703 100644 --- a/docs/examples-docs/steps.md +++ b/docs/examples-docs/steps.md @@ -1,7 +1,38 @@ + + + + ## Steps 步骤条 ### 基础用法 +:::demo ```html 买家下单 @@ -10,6 +41,8 @@ 交易完成 +下一步 + ``` +::: ### 只显示步骤条 +:::demo ```html 买家下单 @@ -37,6 +72,7 @@ export default { 交易完成 ``` +::: ### Steps API diff --git a/docs/examples-docs/switch.md b/docs/examples-docs/switch.md index 75f11bb1e..4316d1c96 100644 --- a/docs/examples-docs/switch.md +++ b/docs/examples-docs/switch.md @@ -1,33 +1,47 @@ + + + ## Switch组件 ### 基础用法 +:::demo ```html -
-

Switch

-

基础用法

-
-
- -
{{switchStateText}}
-
-
- -
ON, DISABLED
-
-
- -
OFF, DISABLED
-
-
- -
ON, LOADING
-
-
- -
OFF, LOADING
-
-
+
+ +
{{switchStateText}}
+
+
+ +
ON, DISABLED
+
+
+ +
OFF, DISABLED
+
+
+ +
ON, LOADING
+
+
+ +
OFF, LOADING
``` +::: ### API diff --git a/docs/examples-docs/tag.md b/docs/examples-docs/tag.md index 05f9a30af..acdbbb8e4 100644 --- a/docs/examples-docs/tag.md +++ b/docs/examples-docs/tag.md @@ -1,17 +1,52 @@ + + ## Tag 组件 ### 基础用法 + +:::demo ```html -返现 -返现 +
+ 返现 + 返现 +
+
+ 返现 + 四字标签 + +
``` +::: ### 高级用法 + +:::demo ```html -返现 -返现 -返现 +
+ 返现 + 返现 +
+
+ 返现 + 返现 +
+
+ 返现 + 返现 +
+
+ 返现 +
``` +::: ### API diff --git a/docs/examples-docs/waterfall.md b/docs/examples-docs/waterfall.md index 3e2b527c3..0ef76c06d 100644 --- a/docs/examples-docs/waterfall.md +++ b/docs/examples-docs/waterfall.md @@ -2,6 +2,7 @@ ### 基础用法 +:::demo ```html
``` +::: ### API diff --git a/docs/examples/search.vue b/docs/examples/search.vue index 41391b5ae..4f3893c13 100644 --- a/docs/examples/search.vue +++ b/docs/examples/search.vue @@ -7,17 +7,19 @@ export default { } }; + + \ No newline at end of file + diff --git a/packages/checkbox/src/checkbox.vue b/packages/checkbox/src/checkbox.vue index c661571fd..6b2f83660 100644 --- a/packages/checkbox/src/checkbox.vue +++ b/packages/checkbox/src/checkbox.vue @@ -2,7 +2,7 @@
-
+
@@ -31,6 +31,10 @@ export default { } else if (index === active) { return 'process'; } + }, + statusClass() { + const status = this.status; + return status ? 'zan-step--' + status : ''; } } }; diff --git a/packages/zanui-css/src/checkbox.css b/packages/zanui-css/src/checkbox.css index 391c1da04..ec3becb1e 100644 --- a/packages/zanui-css/src/checkbox.css +++ b/packages/zanui-css/src/checkbox.css @@ -2,7 +2,9 @@ @component-namespace zan { @b checkbox { - @when disabled { + overflow: hidden; + + @m disabled { .zan-icon { color: #d1dbe5; } @@ -12,6 +14,7 @@ position: relative; height: 22px; margin-right: 15px; + float: left; } @e control { @@ -26,6 +29,8 @@ @e label { line-height: 22px; + margin-left: 37px; + display: block; } .zan-icon { diff --git a/packages/zanui-css/src/radio.css b/packages/zanui-css/src/radio.css index 43fb67afd..141e48e69 100644 --- a/packages/zanui-css/src/radio.css +++ b/packages/zanui-css/src/radio.css @@ -2,7 +2,9 @@ @component-namespace zan { @b radio { - @when disabled { + overflow: hidden; + + @m disabled { .zan-icon { color: #d1dbe5; } @@ -11,7 +13,7 @@ @e input { position: relative; height: 22px; - margin-right: 15px; + float: left; } @e control { @@ -26,6 +28,8 @@ @e label { line-height: 22px; + display: block; + margin-left: 37px; } .zan-icon { diff --git a/packages/zanui-css/src/steps.css b/packages/zanui-css/src/steps.css index 9c36fc87d..eb6c841ca 100644 --- a/packages/zanui-css/src/steps.css +++ b/packages/zanui-css/src/steps.css @@ -53,6 +53,7 @@ margin: 0 0 10px; overflow: hidden; padding-bottom: 20px; + position: relative; } } @@ -105,7 +106,7 @@ .zan-step__circle-container { left: auto; - right: -6px; + right: -8px; } .zan-step__line {