我有以下密码:
{
data: function () {
return {
questions: [],
sendButtonDisable: false,
}
},
methods: {
postQuestionsContent: function () {
var that = this;
that.sendButtonDisable = true;
},
},
},
当调用 postQuestionsContent()
时,我需要将 sendButtonDisable
改为 true。我发现只有一种方法可以做到这一点: 使用 var that = this;
。
还有更好的解决办法吗?