forked from github/dataease
fix:文本框组件,格式框有时不显示问题
This commit is contained in:
parent
c427e548c0
commit
66f6a726cd
@ -2,6 +2,7 @@
|
|||||||
<div v-if="editMode == 'edit'" class="v-text" @keydown="handleKeydown" @keyup="handleKeyup">
|
<div v-if="editMode == 'edit'" class="v-text" @keydown="handleKeydown" @keyup="handleKeyup">
|
||||||
<!-- tabindex >= 0 使得双击时聚集该元素 -->
|
<!-- tabindex >= 0 使得双击时聚集该元素 -->
|
||||||
<div
|
<div
|
||||||
|
v-if="canEdit"
|
||||||
ref="text"
|
ref="text"
|
||||||
:contenteditable="canEdit"
|
:contenteditable="canEdit"
|
||||||
:class="{ canEdit }"
|
:class="{ canEdit }"
|
||||||
@ -14,6 +15,7 @@
|
|||||||
@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>
|
</div>
|
||||||
<div v-else class="v-text">
|
<div v-else class="v-text">
|
||||||
<div :style="{ verticalAlign: element.style.verticalAlign }" v-html="element.propValue" />
|
<div :style="{ verticalAlign: element.style.verticalAlign }" v-html="element.propValue" />
|
||||||
@ -110,6 +112,10 @@ export default {
|
|||||||
|
|
||||||
setEdit() {
|
setEdit() {
|
||||||
this.canEdit = true
|
this.canEdit = true
|
||||||
|
// // // 聚焦到单元格
|
||||||
|
// setTimeout(() => {
|
||||||
|
// this.$refs['text'].focus()
|
||||||
|
// }, 500)
|
||||||
// 全选
|
// 全选
|
||||||
this.selectText(this.$refs.text)
|
this.selectText(this.$refs.text)
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user