v-text和v-html绑定数据显示
1.v-text:相当有js的$("#root").text();
2.v-html 相当于js的$("#root").html();
3.插值赋值的数据会被v-text,或者v-html覆盖。并且数据会从左到右覆盖。本例中 v-text 会被v-html覆盖
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width" /> <script src="~/Scripts/vue/vue.js"></script> <title>Index</title> </head> <body> <div id="root" v-text="msg" v-html="number">{{msg}}{{number}} </div> </body> </html> <script type="text/javascript"> new Vue({ el: "#root", data: { msg: "hello word", number:123 } }); </script>