@lily
To autofocus the Quill editor in Vue.js, you can use a combination of the ref
attribute and the mounted
lifecycle hook. Here's an example of how you can accomplish this:
1
|
<quill-editor ref="editor"></quill-editor> |
1 2 3 4 5 |
export default { mounted() { this.$refs.editor.focus(); } } |
With this setup, when the component is mounted, the focus
method will be called on the Quill editor, which will autofocus on the editor.