Sign in

nx / creditNx · Files

Logo

GitLab

  • Back to group
  • Project
  • Activity
  • Files
  • Commits
  • Network
  • Graphs
  • Milestones
  • Issues 0
  • Merge Requests 0
  • Labels
  • Wiki
  • creditNx
  • ruoyi-ui
  • src
  • components
  • DictData
  • index.js
  • 使用vue-data-dict,简化数据字典使用
    12ab8b03
    RuoYi authored
    2021-09-17 15:36:54 +0800  
    Browse Code ยป
index.js 431 Bytes
Edit Raw Blame History
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
import Vue from 'vue'
import DataDict from '@/utils/dict'
import { getDicts as getDicts } from '@/api/system/dict/data'

function install() {
  Vue.use(DataDict, {
    metas: {
      '*': {
        labelField: 'dictLabel',
        valueField: 'dictValue',
        request(dictMeta) {
          return getDicts(dictMeta.type).then(res => res.data)
        },
      },
    },
  })
}

export default {
  install,
}