浏览代码

全局挂载字典标签组件

RuoYi 3 年之前
父节点
当前提交
aee1e53140
共有 3 个文件被更改,包括 5 次插入12 次删除
  1. 5 2
      ruoyi-ui/src/main.js
  2. 0 5
      ruoyi-ui/src/views/system/dict/data.vue
  3. 0 5
      ruoyi-ui/src/views/system/dict/index.vue

+ 5 - 2
ruoyi-ui/src/main.js

@@ -18,9 +18,11 @@ import { getDicts } from "@/api/system/dict/data";
 import { getConfigKey } from "@/api/system/config";
 import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, download, handleTree } from "@/utils/ruoyi";
 import Pagination from "@/components/Pagination";
-// 自定义表格工具扩展
+// 自定义表格工具组件
 import RightToolbar from "@/components/RightToolbar"
-// 头部标签插件
+// 字典标签组件
+import DictTag from '@/components/DictTag'
+// 头部标签组件
 import VueMeta from 'vue-meta'
 
 // 全局方法挂载
@@ -47,6 +49,7 @@ Vue.prototype.msgInfo = function (msg) {
 }
 
 // 全局组件挂载
+Vue.component('DictTag', DictTag)
 Vue.component('Pagination', Pagination)
 Vue.component('RightToolbar', RightToolbar)
 

+ 0 - 5
ruoyi-ui/src/views/system/dict/data.vue

@@ -185,14 +185,9 @@
 <script>
 import { listData, getData, delData, addData, updateData, exportData } from "@/api/system/dict/data";
 import { listType, getType } from "@/api/system/dict/type";
-// 字典标签组件(使用频繁可在全局挂载)
-import DictTag from '@/components/DictTag'
 
 export default {
   name: "Data",
-  components: {
-    DictTag
-  },
   data() {
     return {
       // 遮罩层

+ 0 - 5
ruoyi-ui/src/views/system/dict/index.vue

@@ -194,14 +194,9 @@
 
 <script>
 import { listType, getType, delType, addType, updateType, exportType, refreshCache } from "@/api/system/dict/type";
-// 字典标签组件(使用频繁可在全局挂载)
-import DictTag from '@/components/DictTag'
 
 export default {
   name: "Dict",
-  components: {
-    DictTag
-  },
   data() {
     return {
       // 遮罩层