vuetify封装全局组件 通过this.xx()直接调用
添加全局组件
封装全局组件,类似 toast,modal 可以通过this.xx() 直接调用
以Vuetifyjs Dialog 为例子
最终效果 通过调用 this.dialog()
可以直接在界面上显示 该组件
实现内容
在components下创建Dialog.vue,代码如下:
<template>
<v-row justify="center">
<v-dialog
v-model="visible"
persistent
:fullscreen="fullscreen"
:max-width="maxWidth"
:width="width"
:hide-overlay="overlay"
>
<div class="overlay"></div>
<v-card>
<v-card-title
><span class="headline">{
{ title }}</span></v-card-title
>
<v-card-text v-html="content"><