diff --git a/example/pages/steps/index.wxml b/example/pages/steps/index.wxml index 49dad535..79936558 100644 --- a/example/pages/steps/index.wxml +++ b/example/pages/steps/index.wxml @@ -49,10 +49,18 @@ - - - - + + + + + + diff --git a/example/pages/steps/index.wxss b/example/pages/steps/index.wxss index 1a313e5f..3991d239 100644 --- a/example/pages/steps/index.wxss +++ b/example/pages/steps/index.wxss @@ -1,6 +1,11 @@ .my-class { - padding: 10px; + margin: 20px; } -.my-class .zan-steps__step--done { - color: #f44; + +.gray { + background-color: #ccc !important; +} + +.white { + color: #fff !important; } diff --git a/packages/steps/README.md b/packages/steps/README.md index 0e9354fa..8049aa09 100644 --- a/packages/steps/README.md +++ b/packages/steps/README.md @@ -13,18 +13,74 @@ "zan-steps": "path/to/zanui-weapp/dist/steps/index" } } +``` ### 代码演示 -在模板中使用 zan-steps 模板,并传入相应数据 + +#### 基础用法 + ```html ``` + +#### 2步完成 + +```html + +``` + +```js +steps: [ + { + done: true, + current: false, + text: '步骤一', + desc: '10.01' + }, + { + done: false, + current: true, + text: '步骤二', + desc: '10.02' + } +] +``` + +#### 有描述的steps + +```html + +``` + +#### 垂直方向的steps + +```html + +``` + +#### 自定义 class + +```html + +``` + + + | 参数 | 说明 | 类型 | 默认值 | 必须 | |-----------|-----------|-----------|-------------|-------------| | type | steps 的展示状态,可选值为 'horizon', 'vertical' | String | horizon | | | hasDesc | 是否展示描述 | Boolean | false | | | steps | 步骤条展示数据 | Array | | 必须 | -| className | 自定义类目,方便自定义显示 | String | | | +| steps-class | 自定义类,可改变steps外层样式 | String | | | +| icon-class | 自定义类,可改变icon样式 | String | | | +| title-class | 自定义类,可改变标题样式 | String | | | +| desc-class | 自定义类,可改变描述样式 | String | | | steps 数据格式如下: ```js diff --git a/packages/steps/index.js b/packages/steps/index.js index 7e096916..a4956108 100644 --- a/packages/steps/index.js +++ b/packages/steps/index.js @@ -1,4 +1,5 @@ Component({ + externalClasses: ['steps-class', 'icon-class', 'title-class', 'desc-class'], properties: { type: { type: String, diff --git a/packages/steps/index.wxml b/packages/steps/index.wxml index cdcfbafa..ee707ed6 100644 --- a/packages/steps/index.wxml +++ b/packages/steps/index.wxml @@ -1,11 +1,11 @@ - + - {{ step.text }} - {{ step.desc }} - + {{ step.text }} + {{ step.desc }} + diff --git a/packages/steps/wxss/vstep.pcss b/packages/steps/wxss/vstep.pcss index 4dfa57f8..7fe8c3a6 100644 --- a/packages/steps/wxss/vstep.pcss +++ b/packages/steps/wxss/vstep.pcss @@ -44,7 +44,7 @@ .zan-steps--vsteps .zan-steps__circle { width: 5px; height: 5px; - background-color: #cacaca; + background-color: #e5e5e5; border-radius: 10px; }