1倔矾、v-model(綁定數(shù)據(jù))
2、v-for(循環(huán))
3、v-on(綁定事件)
4哪自、$index(索引)
5丰包、v-if(不滿足條件的話則不會(huì)出現(xiàn)在dom中)
6、v-show(不滿足條件壤巷,則樣式會(huì)設(shè)置成隱藏 display:none;)
HTML:
<h1 v-show="ok">Hello!</h1>
JS:
data() {
return {
ok:true
}
},
7邑彪、data(數(shù)據(jù))
data() {
return {
status:{
"true":"已開(kāi)通",
"false":"未開(kāi)通",
"fail":"審核失敗"
},
currentPage:1,
currentLimit:10,
tableData3: []
}
},
8、生命周期
beforeCreate() {
console.log('beforeCreate:頁(yè)面創(chuàng)建之前')
},
created() {
console.log('created:頁(yè)面創(chuàng)建完成')
},
beforeMount() {
console.log('beforeMount:頁(yè)面掛載之前')
},
mounted() {
console.log('mounted:頁(yè)面掛載完成')
this.getList();
},
beforeUpdate() {
console.log('beforeUpdate:數(shù)據(jù)更新之前')
},
updated() {
console.log('updated:數(shù)據(jù)更新完成')
},
beforeDestroy() {
console.log('beforeDestroy:頁(yè)面卸載之前')
},
destroyed() {
console.log('destroyed:頁(yè)面卸載完成')
},
9胧华、methods(方法)
methods: {
//編輯操作
handleEdit(index,item){
console.log('編輯方法')
},
//刪除操作
handleDelete(index,item){
console.log('刪除方法')
}
}