点击事件绑定三目运算
<Button type="warning" @click="qiehuan?save():edit()" class="edit">{{this.zhi}}</Button>
注意!!函数调用要有(),因为我没括号调用不了
关闭当前页
在vuex里面存储函数
mutations:{
closeTag (state, route) {
const tag = state.tagNavList.filter(item => routeEqual(item, route))
route = tag[0] ? tag[0] : null
if (!route) return
closePage(state, route)
},
}
在所需页面引用
import { mapMutations } from 'vuex'
...mapMutations([
'closeTag'
]),
返回上一层
this.closeTag({
name: '图形编辑',
params: {
code: this.$route.params.code
}
})
v-show v-if控制隐藏展示