vue calculation method using JavaScript
code show as below:
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>vue.js 使用 javascript </title> <script src="vue.js"></script> </head> <style> .color_1{color: red;} .color_2{color: blue;</} style > < body > < div ID = "ASK" > <-! VUE not control body and html tags -> < h1 of > {{NUM}} </ h1 of > < H2 V-Once = "" > { NUM}} {: Once-V </ H2 > {NUM +. 1 {}} <-! expression -> < h1 of : class = " 'Color _' + NUM" > {{}} title </ h1 of > < the INPUT of the type = "text" v-model="num"> <input type="radio" v-model="num" value="1">color_1 <input type="radio" v-model="num" value="2">color_2 </div> <script> var app = new Vue({ //实例化vue el:'#ask',//vue控制id为ask的元素, data:{ title:'ask.mykeji.net', on one:1, } }); </script> </body> </html>