Vuetify框架:从函数中切换徽章

时间:2018-01-09 22:30:40

标签: javascript vuejs2 toggle vuetify.js

我需要通过名为 openNotifications 的函数切换徽章。目前,徽章只能通过按钮切换。

按钮:

let search = "\\12345\1";

let filter = search.replace('\', '\\');
let regex = new RegExp("^" + text);

return MyModel.find({ path: regex }).exec();

App.vue: 打开通知

<v-btn @click.native="show = !show">toggle badge</v-btn>

如何在 openNotifications 功能中切换按钮?

1 个答案:

答案 0 :(得分:1)

让openNotifcations函数执行与@click函数相同的操作,所以

openNotifications () {
 this.show = !this.show 
}
相关问题