File tree 2 files changed +10
-4
lines changed
2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -1020,9 +1020,12 @@ Including the boolean properties of svelte-jsoneditor like `readOnly` with no va
1020
1020
1021
1021
``` vue
1022
1022
<script setup>
1023
- import { onMounted, ref } from 'vue'
1023
+ import { onMounted, useTemplateRef } from 'vue'
1024
1024
1025
- const jsonEditorVueRef = ref()
1025
+ // Vue ≥ v3.5
1026
+ const jsonEditorVueRef = useTemplateRef('jsonEditorVueRef')
1027
+ // Vue < v3.5
1028
+ // const jsonEditorVueRef = ref()
1026
1029
1027
1030
onMounted(() => {
1028
1031
jsonEditorVueRef.value.jsonEditor.focus()
Original file line number Diff line number Diff line change @@ -1018,9 +1018,12 @@ import { Mode } from 'vanilla-jsoneditor'
1018
1018
1019
1019
``` vue
1020
1020
<script setup>
1021
- import { onMounted, ref } from 'vue'
1021
+ import { onMounted, useTemplateRef } from 'vue'
1022
1022
1023
- const jsonEditorVueRef = ref()
1023
+ // Vue ≥ v3.5
1024
+ const jsonEditorVueRef = useTemplateRef('jsonEditorVueRef')
1025
+ // Vue < v3.5
1026
+ // const jsonEditorVueRef = ref()
1024
1027
1025
1028
onMounted(() => {
1026
1029
jsonEditorVueRef.value.jsonEditor.focus()
You can’t perform that action at this time.
0 commit comments