+
-
@@ -82,20 +54,31 @@ body{padding:20px;}
layui.use(['rate'], function(){
var rate = layui.rate;
- //设置全局
- rate.set({
- score: 3.5
- });
-
-
- var ins = rate.render({
- elem: '#test1'
+ //渲染
+ rate.render({
+ elem: '#test1',
+ length: 7,
+ value: 4
+ })
+ rate.render({
+ elem: '#test2',
+ length: 6,
+ value: 2,
+ half: true
+ })
+ rate.render({
+ elem: '#test3',
+ length: 5,
+ value: 3,
+ text: true
+ })
+ rate.render({
+ elem: '#test4',
+ length: 8,
+ value: 5,
+ reader: true
})
-
- rate.primary(".layui-rate-primary","li");
- rate.half(".layui-rate-half","li");
- rate.text(".layui-rate-text","li");
});