Przeglądaj źródła

去除不必要代码

zhuliu 1 rok temu
rodzic
commit
c683da9601

+ 3 - 0
src/utils/model/tooltip/index.vue

@@ -1,5 +1,8 @@
 <template>
   <el-tooltip class="item" :disabled="!disable" v-bind="$attrs" ref="myToolTip">
+    <template #content="scopeData">
+        <slot name="content"  v-bind="scopeData || {}"></slot>
+    </template>
     <template>
         <slot></slot>
     </template>

+ 25 - 0
src/views/home/components/showDialog.js

@@ -0,0 +1,25 @@
+import showDialog from './visualDialog.vue'
+import Vue from 'vue'
+import router from '@/router'
+const Toast = {};
+
+// 注册Toast
+
+Toast.install = function(Vue) {
+    const ToastConstructor = Vue.extend(showDialog)
+
+    const instance = new ToastConstructor({ router });
+
+    instance.$mount()
+    document.body.appendChild(instance.$el)
+
+
+    Vue.prototype.$showDialog = (msg, flag, id, duration = 1500) => {
+        instance.visuals = msg;
+        instance.dialogVisible = flag;
+        instance.id = id
+    }
+
+}
+
+export default Toast