Vuetify 框架:从函数中切换徽章
Vuetify framework: Toggle a badge from within a function
我需要通过名为 openNotifications 的函数切换徽章。目前徽章只能通过按钮切换。
按钮:
<v-btn @click.native="show = !show">toggle badge</v-btn>
App.vue:
打开通知
<script>
export default {
methods: {
openNotifications () {
bus.$emit('dialog', true)
}
[...]
</script>
如何在 openNotifications 函数中切换按钮?
让 openNotifcations 函数执行与 @click 函数相同的操作,因此
openNotifications () {
this.show = !this.show
}
我需要通过名为 openNotifications 的函数切换徽章。目前徽章只能通过按钮切换。
按钮:
<v-btn @click.native="show = !show">toggle badge</v-btn>
App.vue: 打开通知
<script>
export default {
methods: {
openNotifications () {
bus.$emit('dialog', true)
}
[...]
</script>
如何在 openNotifications 函数中切换按钮?
让 openNotifcations 函数执行与 @click 函数相同的操作,因此
openNotifications () {
this.show = !this.show
}