提交 db09c658 authored 作者: wangjiahao's avatar wangjiahao

fix: 仪表板文字组件编辑文字可能保存不上问题

上级 77db7609
...@@ -229,7 +229,6 @@ export default { ...@@ -229,7 +229,6 @@ export default {
}, },
methods: { methods: {
_isMobile() { _isMobile() {
console.log('navigator.userAgent:' + navigator.userAgent)
const flag = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i) const flag = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)
this.terminal = flag ? 'mobile' : 'pc' this.terminal = flag ? 'mobile' : 'pc'
// this.terminal = 'mobile' // this.terminal = 'mobile'
...@@ -311,7 +310,7 @@ export default { ...@@ -311,7 +310,7 @@ export default {
} }
}, },
handleMouseDown() { handleMouseDown() {
this.$store.commit('setClickComponentStatus', fals) this.$store.commit('setClickComponentStatus', false)
}, },
initMobileCanvas() { initMobileCanvas() {
this.$store.commit('openMobileLayout') this.$store.commit('openMobileLayout')
......
...@@ -15,7 +15,16 @@ ...@@ -15,7 +15,16 @@
@input="handleInput" @input="handleInput"
v-html="element.propValue" v-html="element.propValue"
/> />
<div v-if="!canEdit" :style="{ verticalAlign: element.style.verticalAlign }" @dblclick="setEdit" v-html="element.propValue" /> <div
v-if="!canEdit"
:style="{ verticalAlign: element.style.verticalAlign }"
@dblclick="setEdit"
@paste="clearStyle"
@mousedown="handleMousedown"
@blur="handleBlur"
@input="handleInput"
v-html="element.propValue"
/>
</div> </div>
<div v-else class="v-text"> <div v-else class="v-text">
<div :style="{ verticalAlign: element.style.verticalAlign }" v-html="textInfo" /> <div :style="{ verticalAlign: element.style.verticalAlign }" v-html="textInfo" />
...@@ -75,6 +84,7 @@ export default { ...@@ -75,6 +84,7 @@ export default {
}, },
methods: { methods: {
handleInput(e) { handleInput(e) {
this.$store.state.styleChangeTimes++
this.$emit('input', this.element, e.target.innerHTML) this.$emit('input', this.element, e.target.innerHTML)
this.$store.commit('recordStyleChange') this.$store.commit('recordStyleChange')
}, },
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论