Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: 优化工单详情页面渲染卡顿问题 #3536

Merged
merged 1 commit into from
Nov 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions src/components/Cards/DetailCard/ItemValue.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ export default {
}
},
data() {
return {
formatterData: ''
}
return {}
},
computed: {
displayValue() {
Expand Down Expand Up @@ -69,19 +67,18 @@ export default {
}
},
render(h) {
let formatterData = ''
if (typeof this.formatter === 'function') {
const data = this.formatter(this.item, this.value)
if (data instanceof Promise) {
data.then(res => {
this.formatterData = res
formatterData = res
})
} else {
if (data instanceof Object && data.hasOwnProperty('componentOptions')) {
this.formatterData = h(data.componentOptions.tag, data.componentOptions.children)
}
this.formatterData = data
}
return (
<span>{this.formatterData}</span>
<span>{formatterData}</span>
)
}
if (this.value instanceof Array) {
Expand Down