We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rater组件的rater.js文件中: /**
点击触发事件 */ bindtap(e) { const i = e.currentTarget.dataset.index const rater = this.page.data.$wux.rater[id] const value = rater.value const disabled = rater.disabled
if (disabled) return !1 if (value === i + 1) { this.page.setData({ [`$wux.rater.${id}.value`]: i }) } else { this.page.setData({ [`$wux.rater.${id}.value`]: i + 1 }) } that.updateStyle(id, this.page) that.updateValue(id, this.page) typeof options.callback === `function` && options.callback(e) }
上面代码中,评分回调函数options.callback(e)的参数e好像并没有带上用户选中评分的value,请问是我理解有误还是有其他方式来获得当前用户选中的评分值,谢谢:)
The text was updated successfully, but these errors were encountered:
this.data.$wux.rater[id].value
Sorry, something went wrong.
谢谢朋友,你的这个组件库做的很不错,我正在考虑学习使用,直接用你提供的this.data.$wux.rater[id].value会报类似"cannot read property $wux of undefined "的错误,下面的代码我是参考小程序官网的写法,在外部通过that传值到callback函数进行后续对data属性的引用,但是不知道能否用es6的箭头函数进行改进呢? onLoad() { var that=this; $wuxRater.init('star', { value: 5, callback:function (e){ console.log(that.data.$wux.rater['star'].value); } }); }
非常感谢您的支持,后续我已经做出了修改,可查看2017-04-09 更新日志。
No branches or pull requests
rater组件的rater.js文件中:
/**
点击触发事件
*/
bindtap(e) {
const i = e.currentTarget.dataset.index
const rater = this.page.data.$wux.rater[id]
const value = rater.value
const disabled = rater.disabled
上面代码中,评分回调函数options.callback(e)的参数e好像并没有带上用户选中评分的value,请问是我理解有误还是有其他方式来获得当前用户选中的评分值,谢谢:)
The text was updated successfully, but these errors were encountered: