在开发过程中遇到一个问题,点击按钮发送短信时,短信按钮上时间倒计时90s。其中button是这么写的
<button id="smsbutton" name="smsbutton" type="button" v-model="smsbutton">{{smsbutton}}</button>
在js中,使用$scope.smsbutton给这个button赋值,发现在js方法中console.log($scope.smsbutton)确实能随着时间倒计时。但是Html上的时间却并没有变化。正确的方法是
document.getElementById("smsbutton").innerHtml=$scope.smsbutton;
事实上这样才是改变的button上面的显示的值,$scope.smsbutton只是改变了这个button本身的值。并没有改变这个{{smsbutton}}