vue模板
2017-11-01 23:19
267 查看
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>模板</title>
</head>
<script type="text/javascript" src="js/vue.js" ></script>
<script>
window.onload = function(){
//配置是否允许检查代码,方便调试,生产环境中设置为false
Vue.config.devtools = true; //检查代码
Vue.config.productioinTip = false; //有强迫症的,可以关掉生产中的提示信息
let vm = new Vue({
el: "#div1",
data:{
msg:'hello world!!!'
},
created:function(){
alert(1111);
}
});
}
</script>
<style type="text/css">
[v-cloak]{
display: none;
}
</style>
<body>
<div id="div1">
<input type="text" v-model="msg">
<h1>aaaa<span v-cloak>`msg`</span></h1> <!-- 防止msg-->
<h1 v-text="msg"></h1> <!--v-text 不能解析html代码-->
<h1 v-html="msg"></h1> <!--v-html 可以解析html代码-->
<h2 v-once>`msg`</h2> <!--只绑定一次,双向绑定改变不了-->
<h3 v-pre>`msg`</h3> <!--当需要输出{{}}时,可以不编译{{}}符号,以文本形式输出-->
</div>
</body>
</html>
<html>
<head>
<meta charset="utf-8" />
<title>模板</title>
</head>
<script type="text/javascript" src="js/vue.js" ></script>
<script>
window.onload = function(){
//配置是否允许检查代码,方便调试,生产环境中设置为false
Vue.config.devtools = true; //检查代码
Vue.config.productioinTip = false; //有强迫症的,可以关掉生产中的提示信息
let vm = new Vue({
el: "#div1",
data:{
msg:'hello world!!!'
},
created:function(){
alert(1111);
}
});
}
</script>
<style type="text/css">
[v-cloak]{
display: none;
}
</style>
<body>
<div id="div1">
<input type="text" v-model="msg">
<h1>aaaa<span v-cloak>`msg`</span></h1> <!-- 防止msg-->
<h1 v-text="msg"></h1> <!--v-text 不能解析html代码-->
<h1 v-html="msg"></h1> <!--v-html 可以解析html代码-->
<h2 v-once>`msg`</h2> <!--只绑定一次,双向绑定改变不了-->
<h3 v-pre>`msg`</h3> <!--当需要输出{{}}时,可以不编译{{}}符号,以文本形式输出-->
</div>
</body>
</html>
相关文章推荐
- Vue模板语法(2)
- vue 模板加载之后 执行js 渲染 DOM
- 使用vscode,新建vue模板
- Vue.js 定义组件模板的七种方式
- vue-cli的webpack模板项目配置文件分析
- Vue模板语法
- Vue-框架模板的源代码注释
- webstorm添加vue模板支持
- vue的模板 <template></template>
- [小tips]使用vscode,根据vue模板文件生成代码
- vue之模板语法
- Vue模板语法
- VUE -- ejs模板的书写
- github项目学习--Vue结合Pug模板引擎
- 用Vue-cli生成vue+webpack的项目模板怎么设置为vue1.0版本?
- Vue的模板语法
- vue-cli-webpack模板配置全解析-1
- Vue的字符串模板
- 基于 vue-cli 的 Vue js 单页应用项目模板
- vue.js--模板语法