diff --git a/examples/rate.html b/examples/rate.html
index 149b7f8..0ac38a9 100644
--- a/examples/rate.html
+++ b/examples/rate.html
@@ -55,13 +55,12 @@ layui.use(['rate'], function(){
var rate = layui.rate;
//渲染
- // var ins1 = rate.render({
- // elem: '#test1'
- // ,length: 7
- // ,value: 4
- // });
- // ins1.setValue(5);
-
+ var ins1 = rate.render({
+ elem: '#test1'
+ ,length: 7
+ ,value: 4
+ });
+ ins1.setvalue(2);
rate.render({
elem: '#test1'
diff --git a/src/lay/modules/rate.js b/src/lay/modules/rate.js
index 93f976d..07a61a2 100644
--- a/src/lay/modules/rate.js
+++ b/src/lay/modules/rate.js
@@ -28,11 +28,8 @@ layui.define('jquery',function(exports){
,options = that.config;
return {
-
- function(value){
- console.log(options)
-
- //that.setValue();
+ setvalue: function(value){
+ that.setvalue.call(that, value);
}
,config: options
}
@@ -99,6 +96,16 @@ layui.define('jquery',function(exports){
};
+ //重置value
+ Class.prototype.setvalue = function(value){
+ var that = this
+ ,options = that.config ;
+
+ options.value = value
+
+ }
+
+
//li触控事件
Class.prototype.action = function(){
var that = this