如下, view里面定义了某个按钮点击的事件处理函数,其中有一个参数是current_quarter;
<t-td @tap="goto_checked_company('cs_official_check_status', 'CHECKED', item.area_en, current_quarter)">{{ item.checked_cnt }}</t-td>
quarter是在data里面的;
data() {
return {
quarters:[],
quartersIdx: 0,
current_quarter: 0, //default value, server side to handle it as special value
有一个选择框会选择quarter,处理函数会设置current_quarter 的值。
quartersPickerChange(e){
this.quartersIdx = e.detail.value;
this.current_quarter = this.quarters[this.quartersIdx]
现在问题是,选择框重新选择了quarter,但是view里面的函数调用使用的quarter不会根据选择框的变化而变化,一直是最初的quarter。 请问这个是什么问题?是否有解决方案?多谢各位老大
3 个回复
小枫叶 - 外包接单加v:wlmk1234567 注明来意
标签直接能写方法?
jameslai (作者)
可以啊
小枫叶 - 外包接单加v:wlmk1234567 注明来意
给个能运行的demo,我看下