Sfoglia il codice sorgente

全局挂载字典标签组件

RuoYi 4 anni fa
parent
commit
dbf42739ca

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

@@ -19,9 +19,11 @@ import { getDicts } from "@/api/system/dict/data";
19 19
 import { getConfigKey } from "@/api/system/config";
20 20
 import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree } from "@/utils/ruoyi";
21 21
 import Pagination from "@/components/Pagination";
22
-// 自定义表格工具扩展
22
+// 自定义表格工具组件
23 23
 import RightToolbar from "@/components/RightToolbar"
24
-// 头部标签插件
24
+// 字典标签组件
25
+import DictTag from '@/components/DictTag'
26
+// 头部标签组件
25 27
 import VueMeta from 'vue-meta'
26 28
 
27 29
 // 全局方法挂载
@@ -48,6 +50,7 @@ Vue.prototype.msgInfo = function (msg) {
48 50
 }
49 51
 
50 52
 // 全局组件挂载
53
+Vue.component('DictTag', DictTag)
51 54
 Vue.component('Pagination', Pagination)
52 55
 Vue.component('RightToolbar', RightToolbar)
53 56
 

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

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

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

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