mirror of
https://github.com/pipipi-pikachu/PPTist.git
synced 2025-04-15 02:20:00 +08:00
perf: 形状进入编辑状态后自动聚焦
This commit is contained in:
parent
a7afcc8232
commit
d26a7a1b43
@ -39,6 +39,10 @@ export default defineComponent({
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
autoFocus: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
setup(props, { emit }) {
|
||||
const store = useStore()
|
||||
@ -107,6 +111,7 @@ export default defineComponent({
|
||||
},
|
||||
editable: () => props.editable,
|
||||
})
|
||||
if (props.autoFocus) editorView.focus()
|
||||
})
|
||||
onUnmounted(() => {
|
||||
editorView && editorView.destroy()
|
||||
|
@ -64,6 +64,7 @@
|
||||
:defaultColor="text.defaultColor"
|
||||
:defaultFontName="text.defaultFontName"
|
||||
:editable="!elementInfo.lock"
|
||||
:autoFocus="true"
|
||||
:value="text.content"
|
||||
@update="value => updateText(value)"
|
||||
@mousedown.stop
|
||||
|
Loading…
x
Reference in New Issue
Block a user