VUE refreshes the method of modifying the data in the page

Because the VUE object is generated, if it is only modified in the VUE object, it is not automatically updated on the page, and the function format is Vue.set on the page on the page, and the function format is Vue.set (Data, “on the page. ‘Para’, ‘Value’), where DATA is the Data object name transmitted when VUE creates, the two parameters are the variable name and value of the Data object, respectively

page initialization code:

mui.init (); var data = {dx: 1400, wcyj: 0, jj: 0, tcbl: 0, tcje: 0, Total : 0}; $ (document) .read .ready (function () {var v = new Vue ({EL: ‘# result’, data: data})})
     
You need to modify the variables in the VUE template:

function Calc () {$ (” #Result “). Show (); yj = $ (” # Yeji “). Val (); vue.set (data, ‘wcyj’, yj); if (YJ
   < 40000) {
			Vue.set(data, 'tcbl', 0.04);
			Vue.set(data, 'jj', 0);
		} else if(yj < 80000) {
			Vue.set(data, 'tcbl', 0.05);
			Vue.set(data, 'jj', 400);
		} else if(yj < 120000) {
			Vue.set(data, 'tcbl', 0.06);
			Vue.set(data, 'jj', 1000);
		} else {
			Vue.set(data, 'tcbl', 0.07);
			Vue.set(data, 'jj', 1500);
		}
		data.tcje = (yj * data.tcbl).toFixed(1);
		data.total = (parseFloat(data.tcje) + parseFloat(data.dx) + parseFloat(data.jj));
	}
 
  The method of this VUE refreshes the data in the page is the full content of Xiaobian sharing, I hope to give you a reference, I hope everyone can support Tumi cloud. 
© Copyright Notice
THE END
Just support it if you like
like0
share
comment Grab the couch

Please log in to comment