dictionary的key改成可选参数避免提示报错

Signed-off-by: 快点洗澡睡觉吧 <16840517@qq.com>
This commit is contained in:
快点洗澡睡觉吧
2024-08-12 12:45:45 +00:00
committed by Gitee
parent 666f072b58
commit 787b7b61c9

View File

@@ -4,7 +4,7 @@ import { DictionaryStore } from '/@/stores/dictionary';
/** /**
* @method 获取指定name字典 * @method 获取指定name字典
*/ */
export const dictionary = (name: string,key:string|number|undefined) => { export const dictionary = (name: string,key?:string|number|undefined) => {
const dict = DictionaryStore() const dict = DictionaryStore()
const dictionary = toRaw(dict.data) const dictionary = toRaw(dict.data)
if(key!=undefined){ if(key!=undefined){