fix undefined

master^2
Pete Matsyburka 1 week ago
parent 1e5f55c1d6
commit 5081e387d0

@ -179,8 +179,11 @@ export default {
}, },
onBlur (e) { onBlur (e) {
setTimeout(() => { setTimeout(() => {
this.value = this.$refs.contenteditable.innerText.trim() || this.modelValue if (this.$refs.contenteditable) {
this.$emit('update:model-value', this.value) this.value = this.$refs.contenteditable.innerText.trim() || this.modelValue
this.$emit('update:model-value', this.value)
}
this.$emit('blur', e) this.$emit('blur', e)
this.isEditable = false this.isEditable = false

@ -180,7 +180,15 @@ export default {
methods: { methods: {
scrollToArea (area) { scrollToArea (area) {
this.$nextTick(() => { 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) { setPageRefs (el) {

@ -290,7 +290,11 @@ export default {
if (resp.ok) { if (resp.ok) {
resp.json().then((data) => { resp.json().then((data) => {
this.$emit('success', data) this.$emit('success', data)
this.$refs.input.value = ''
if (this.$refs.input) {
this.$refs.input.value = ''
}
this.isLoading = false this.isLoading = false
}) })
} else if (resp.status === 422) { } else if (resp.status === 422) {

Loading…
Cancel
Save