diff --git a/src/code/rate.js b/src/code/rate.js
new file mode 100644
index 0000000..ab50f70
--- /dev/null
+++ b/src/code/rate.js
@@ -0,0 +1,89 @@
+let code = {};
+
+code.import = `
+"usingComponents": {
+ "i-rate": "../../dist/rate/index"
+}
+`;
+code.usage = `
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{starIndex2}}星
+
+
+
+
+ {{starIndex3}}星
+
+
+
+
+ {{starIndex4}}星
+
+
+
+`;
+
+code.js = `
+Page({
+ data : {
+ starIndex1 : 0,
+ starIndex2 : 0,
+ starIndex3 : 0,
+ starIndex4 : 4,
+ starIndex5 : 5
+ },
+ onChange1(e){
+ const index = e.detail.index;
+ this.setData({
+ 'starIndex1' : index
+ })
+ },
+ onChange2(e){
+ const index = e.detail.index;
+ this.setData({
+ 'starIndex2' : index
+ })
+ },
+ onChange3(e){
+ const index = e.detail.index;
+ this.setData({
+ 'starIndex3' : index
+ })
+ },
+ onChange5(e){
+ const index = e.detail.index;
+ this.setData({
+ 'onChange5' : index
+ })
+ }
+});
+`;
+
+export default code;
\ No newline at end of file
diff --git a/src/router.js b/src/router.js
index 8b7580c..fe434df 100755
--- a/src/router.js
+++ b/src/router.js
@@ -219,6 +219,13 @@ const routers = [
},
component: (resolve) => require(['./views/components/switch.vue'], resolve)
},
+ {
+ path: '/components/rate',
+ meta: {
+ title: '评分 Rate'
+ },
+ component: (resolve) => require(['./views/components/rate.vue'], resolve)
+ },
{
path: '*',
redirect: '/'
diff --git a/src/views/components/rate.vue b/src/views/components/rate.vue
new file mode 100644
index 0000000..bf68810
--- /dev/null
+++ b/src/views/components/rate.vue
@@ -0,0 +1,108 @@
+
+
+
+ Rate 评分
+
+ 对事物进行快速的评级操作,或对评价进行展示。
+
+ 在 .json 中引入组件
+ {{ code.import }}
+
+ {{ code.usage }}
+
+ {{ code.js }}
+
+
+
+
+
+
+
+
+ 属性 |
+ 说明 |
+ 类型 |
+ 默认值 |
+
+
+
+
+ i-class |
+ 自定义 class 类名 |
+ String |
+ - |
+
+
+ count |
+ star 总数 |
+ Number |
+ 5 |
+
+
+ value |
+ 当前 star 数 |
+ Number |
+ 0 |
+
+
+ disabled |
+ 是否只读,无法进行交互 |
+ Boolean |
+ false |
+
+
+ size |
+ 图标大小,单位 px |
+ String |
+ 20 |
+
+
+ name |
+ 隐藏的 input 的 name 值 |
+ String |
+ - |
+
+
+
+
+
+
+
+ 事件名 |
+ 说明 |
+ 返回值 |
+
+
+
+
+ bind:change |
+ 点击评分时触发 |
+ { index } |
+
+
+
+
+
+
+
+
\ No newline at end of file