1、v-model(绑定数据)
2、v-for(循环)
3、v-on(绑定事件)
4、$index(索引)
5、v-if(不满足条件的话则不会出现在dom中)
6、v-show(不满足条件,则样式会设置成隐藏 display:none;)
HTML:
<h1 v-show="ok">Hello!</h1>
JS:
data() {
return {
ok:true
}
},
7、data(数据)
data() {
return {
status:{
"true":"已开通",
"false":"未开通",
"fail":"审核失败"
},
currentPage:1,
currentLimit:10,
tableData3: []
}
},
8、生命周期
beforeCreate() {
console.log('beforeCreate:页面创建之前')
},
created() {
console.log('created:页面创建完成')
},
beforeMount() {
console.log('beforeMount:页面挂载之前')
},
mounted() {
console.log('mounted:页面挂载完成')
this.getList();
},
beforeUpdate() {
console.log('beforeUpdate:数据更新之前')
},
updated() {
console.log('updated:数据更新完成')
},
beforeDestroy() {
console.log('beforeDestroy:页面卸载之前')
},
destroyed() {
console.log('destroyed:页面卸载完成')
},
9、methods(方法)
methods: {
//编辑操作
handleEdit(index,item){
console.log('编辑方法')
},
//删除操作
handleDelete(index,item){
console.log('删除方法')
}
}
网友评论