mirror of
https://github.com/element-plus/element-plus.git
synced 2025-01-18 10:59:10 +08:00
fix: capitalize the first letter of the error message (#3882)
* Fix: fix erros message typo Co-authored-by: linkun.he <helinkun@ithinkdt.com> Co-authored-by: Herrington Darkholme <2883231+HerringtonDarkholme@users.noreply.github.com>
This commit is contained in:
parent
39c286f140
commit
e8043abca8
@ -26,7 +26,7 @@ export default {
|
||||
return new Promise((resolve) => {
|
||||
setTimeout(() => {
|
||||
status1.loading1 = false
|
||||
ElMessage.success('switch success')
|
||||
ElMessage.success('Switch success')
|
||||
return resolve(true)
|
||||
}, 1000)
|
||||
})
|
||||
@ -42,8 +42,8 @@ export default {
|
||||
return new Promise((_, reject) => {
|
||||
setTimeout(() => {
|
||||
status2.loading2 = false
|
||||
ElMessage.error('switch failed')
|
||||
return reject(new Error('error'))
|
||||
ElMessage.error('Switch failed')
|
||||
return reject(new Error('Error'))
|
||||
}, 1000)
|
||||
})
|
||||
}
|
||||
|
@ -121,7 +121,7 @@ export default defineComponent({
|
||||
target.value =
|
||||
document.querySelector<HTMLElement>(props.target) ?? undefined
|
||||
if (!target.value) {
|
||||
throw new Error(`target is not existed: ${props.target}`)
|
||||
throw new Error(`Target is not existed: ${props.target}`)
|
||||
}
|
||||
} else {
|
||||
target.value = document.documentElement
|
||||
|
@ -260,7 +260,7 @@ describe('Switch.vue', () => {
|
||||
this.loading = false
|
||||
return this.asyncResult == 'success'
|
||||
? resolve(true)
|
||||
: reject(new Error('error'))
|
||||
: reject(new Error('Error'))
|
||||
}, 1000)
|
||||
})
|
||||
},
|
||||
|
@ -200,7 +200,7 @@ function useRender<T>(props: Partial<TableBodyProps<T>>) {
|
||||
}
|
||||
const childKey = getRowIdentity(node, rowKey.value)
|
||||
if (childKey === undefined || childKey === null) {
|
||||
throw new Error('for nested data item, row-key is required.')
|
||||
throw new Error('For nested data item, row-key is required.')
|
||||
}
|
||||
cur = { ...treeData.value[childKey] }
|
||||
// 对于当前节点,分成有无子节点两种情况。
|
||||
|
@ -62,10 +62,10 @@ class TableLayout<T> {
|
||||
}
|
||||
}
|
||||
if (!this.table) {
|
||||
throw new Error('table is required for Table Layout')
|
||||
throw new Error('Table is required for Table Layout')
|
||||
}
|
||||
if (!this.store) {
|
||||
throw new Error('store is required for Table Layout')
|
||||
throw new Error('Store is required for Table Layout')
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -149,7 +149,7 @@ export const getRowIdentity = <T>(
|
||||
row: T,
|
||||
rowKey: string | ((row: T) => any)
|
||||
): string => {
|
||||
if (!row) throw new Error('row is required when get row identity')
|
||||
if (!row) throw new Error('Row is required when get row identity')
|
||||
if (typeof rowKey === 'string') {
|
||||
if (rowKey.indexOf('.') < 0) {
|
||||
return `${row[rowKey]}`
|
||||
|
@ -251,7 +251,7 @@ class Node {
|
||||
}
|
||||
|
||||
insertChild(child?: FakeNode | Node, index?: number, batch?: boolean): void {
|
||||
if (!child) throw new Error('insertChild error: child is required.')
|
||||
if (!child) throw new Error('InsertChild error: child is required.')
|
||||
|
||||
if (!(child instanceof Node)) {
|
||||
if (!batch) {
|
||||
|
@ -68,7 +68,7 @@ export function getPropByPath(
|
||||
tempObj = tempObj[key]
|
||||
} else {
|
||||
if (strict) {
|
||||
throw new Error('please transfer a valid prop path to form item!')
|
||||
throw new Error('Please transfer a valid prop path to form item!')
|
||||
}
|
||||
break
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user