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:
deepthan 2021-10-15 17:51:15 +08:00 committed by GitHub
parent 39c286f140
commit e8043abca8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 11 additions and 11 deletions

View File

@ -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)
})
}

View File

@ -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

View File

@ -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)
})
},

View File

@ -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] }
// 对于当前节点,分成有无子节点两种情况。

View File

@ -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')
}
}

View File

@ -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]}`

View File

@ -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) {

View File

@ -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
}