fix: 修复搜索组件一系列bug

This commit is contained in:
chenjinsong
2022-06-15 20:41:21 +08:00
parent 70c98f0274
commit 7a2674b7d4
7 changed files with 95 additions and 17 deletions

View File

@@ -1,3 +1,4 @@
import i18n from '@/i18n'
export const errorTypes = {
illegalChar: 'parse.errorTip.illegalChar', // 非法字符
syntaxError: 'parse.errorTip.syntaxError', // 语法错误此i18n内容有占位符
@@ -15,9 +16,13 @@ export const errorDesc = {
},
typeError: {
str: 'parse.errorTip.typeError.expectString', // Expected parameter type is string
number: 'parse.errorTip.typeError.expectNumber', // Expected parameter type is number
meta: 'parse.errorTip.typeError.expectMetaArray' // Expected parameter type is Meta array
}
}
export function handleErrorTip (error) {
return i18n.global.t(error.type) + ': ' + i18n.global.t(error.desc) + ', at index ' + error.index
}
export default class ParserError {
constructor (index, type, desc) {
this.index = index