From 0d751548bb9661e944f603f4c1f6dbb1cd158c57 Mon Sep 17 00:00:00 2001 From: nrz Date: Sat, 14 Apr 2018 11:40:31 +0800 Subject: [PATCH] =?UTF-8?q?[refactor]=20steps:=E5=8D=87=E7=BA=A7=E4=B8=BA?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E7=BB=84=E4=BB=B6=20(#192)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/pages/steps/index.json | 5 ++++- example/pages/steps/index.wxml | 18 +++++++++--------- packages/steps/README.md | 13 ++++++++----- packages/steps/index.js | 20 ++++++++++++++++++++ packages/steps/index.json | 3 +++ packages/steps/index.wxml | 24 +++++++++++------------- 6 files changed, 55 insertions(+), 28 deletions(-) create mode 100644 packages/steps/index.js create mode 100644 packages/steps/index.json diff --git a/example/pages/steps/index.json b/example/pages/steps/index.json index 284a7d5d..a61e34a4 100644 --- a/example/pages/steps/index.json +++ b/example/pages/steps/index.json @@ -1,3 +1,6 @@ { - "navigationBarTitleText": "Steps 步骤条" + "navigationBarTitleText": "Steps 步骤条", + "usingComponents": { + "zan-steps": "../../dist/steps/index" + } } diff --git a/example/pages/steps/index.wxml b/example/pages/steps/index.wxml index 8b9c459c..36364b4d 100644 --- a/example/pages/steps/index.wxml +++ b/example/pages/steps/index.wxml @@ -7,19 +7,19 @@ - + - + - + @@ -28,19 +28,19 @@ - + - + - + @@ -49,13 +49,13 @@ - + - + @@ -63,7 +63,7 @@ 可自定义class - + diff --git a/packages/steps/README.md b/packages/steps/README.md index d92f1ceb..0e9354fa 100644 --- a/packages/steps/README.md +++ b/packages/steps/README.md @@ -6,15 +6,18 @@ @import "path/to/zanui-weapp/dist/index.wxss"; ``` -在需要使用的页面里引入组件库模板和脚本 -```html - -``` +在 index.json 中引入组件 +```json +{ + "usingComponents": { + "zan-steps": "path/to/zanui-weapp/dist/steps/index" + } +} ### 代码演示 在模板中使用 zan-steps 模板,并传入相应数据 ```html - + ``` | 参数 | 说明 | 类型 | 默认值 | 必须 | |-----------|-----------|-----------|-------------|-------------| diff --git a/packages/steps/index.js b/packages/steps/index.js new file mode 100644 index 00000000..651992f4 --- /dev/null +++ b/packages/steps/index.js @@ -0,0 +1,20 @@ +Component({ + properties: { + type: { + type: String, + value: 'horizon' + }, + + hasDesc: { + type: Boolean, + value: false + }, + + steps: { // 必须 + type: Array, + value: [] + }, + + className: String + } +}) diff --git a/packages/steps/index.json b/packages/steps/index.json new file mode 100644 index 00000000..467ce294 --- /dev/null +++ b/packages/steps/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/packages/steps/index.wxml b/packages/steps/index.wxml index 7e57b18b..cdcfbafa 100644 --- a/packages/steps/index.wxml +++ b/packages/steps/index.wxml @@ -1,15 +1,13 @@ - +