Fixed error reporting for component JsonHighlight (#8061)

Update_README
labbomb 2022-01-15 21:05:01 +08:00 committed by GitHub
parent 805ad72e42
commit f4a8502d43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -21,18 +21,18 @@ import { isBoolean, isNumber, isPlainObject } from 'lodash'
import styles from './json-highlight.module.scss'
const props = {
json: {
type: String as PropType<string>,
default: ''
rowData: {
type: Object as PropType<object>,
default: {}
}
}
const JsonHighlight = defineComponent({
name: 'JsonHighlight',
props,
render() {
render(props: { rowData: { connectionParams: string } }) {
return (
<pre class={styles['json-highlight']}>{syntaxHighlight(this.json)}</pre>
<pre class={styles['json-highlight']}>{syntaxHighlight(props.rowData.connectionParams)}</pre>
)
}
})

View File

@ -64,7 +64,7 @@ export function useColumns(onCallback: Function) {
}
),
default: () =>
h(JsonHighlight, { json: rowData.connectionParams }, null)
h(JsonHighlight, { rowData })
}
)
}