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 @@ - +