fix undefined
This commit is contained in:
@@ -179,8 +179,11 @@ export default {
|
||||
},
|
||||
onBlur (e) {
|
||||
setTimeout(() => {
|
||||
this.value = this.$refs.contenteditable.innerText.trim() || this.modelValue
|
||||
this.$emit('update:model-value', this.value)
|
||||
if (this.$refs.contenteditable) {
|
||||
this.value = this.$refs.contenteditable.innerText.trim() || this.modelValue
|
||||
this.$emit('update:model-value', this.value)
|
||||
}
|
||||
|
||||
this.$emit('blur', e)
|
||||
|
||||
this.isEditable = false
|
||||
|
||||
@@ -180,7 +180,15 @@ export default {
|
||||
methods: {
|
||||
scrollToArea (area) {
|
||||
this.$nextTick(() => {
|
||||
this.pageRefs[area.page].areaRefs.find((e) => e.area === area).$el.scrollIntoView({ behavior: 'smooth', block: 'center' })
|
||||
const pageRef = this.pageRefs[area.page]
|
||||
|
||||
if (pageRef && pageRef.areaRefs) {
|
||||
const areaRef = pageRef.areaRefs.find((e) => e.area === area)
|
||||
|
||||
if (areaRef && areaRef.$el) {
|
||||
areaRef.$el.scrollIntoView({ behavior: 'smooth', block: 'center' })
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
setPageRefs (el) {
|
||||
|
||||
@@ -290,7 +290,11 @@ export default {
|
||||
if (resp.ok) {
|
||||
resp.json().then((data) => {
|
||||
this.$emit('success', data)
|
||||
this.$refs.input.value = ''
|
||||
|
||||
if (this.$refs.input) {
|
||||
this.$refs.input.value = ''
|
||||
}
|
||||
|
||||
this.isLoading = false
|
||||
})
|
||||
} else if (resp.status === 422) {
|
||||
|
||||
Reference in New Issue
Block a user