Skip to content

字典

安装上下文

ts
createLumalAdmin({
  dictionary: {
    fetcher: async (dictionary) => {
      const res = await api.getDict(dictionary)
      return { items: res.items }
    },
  },
})

标准项:labelvaluecolor?disabled?children?

在 Schema 中使用

ts
{ field: 'status', label: '状态', dictionary: 'status' }
  • 存在 dictionary / dictType 时优先用字典结果
  • 表格字典带 color 时渲染「色点 + 文本」,颜色不作为唯一信息

关闭字典

ts
createLumalAdmin({ dictionary: false })

基于 MIT 许可发布 · Vue 3 · TypeScript · Vite · Element Plus