1
0
mirror of https://gitee.com/vant-contrib/vant-weapp.git synced 2025-04-06 03:58:05 +08:00

21 lines
361 B
JavaScript

import Page from '../../common/page';
const format = rate => Math.min(Math.max(rate, 0), 100);
Page({
data: {
value: 25,
gradientColor: {
'0%': '#ffd01e',
'100%': '#ee0a24'
}
},
run(e) {
const step = parseFloat(e.currentTarget.dataset.step);
this.setData({
value: format((this.data.value += step))
});
}
});