Skip to content

Commit

Permalink
feat(vue): refine
Browse files Browse the repository at this point in the history
  • Loading branch information
baurine committed Jul 25, 2024
1 parent bbe8074 commit d6091d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/vue/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ When `EditorCacheProvide` unmounts, it will clear all the cached editor instance

## API

### EditorCacheProvider
### EditorCacheProvide

- `const cache=inject('editor-cache')`: get the cache
- `cache.addEditor(editorId, instance)`: add new editor instance
Expand Down
5 changes: 3 additions & 2 deletions packages/vue/src/sql-editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ function editorIdChange(newId: string, oldId: string) {
editorId: newId
})
editorCache.addEditor(newId, newInst)
} else {
newInst.changeTheme(props.theme ?? [])
newInst.changeSQLConfig(props.sqlConfig ?? {})
}
newInst.changeTheme(props.theme ?? [])
newInst.changeSQLConfig(props.sqlConfig ?? {})
editorContainerRef.value.appendChild(newInst.editorView.dom)
newInst.editorView.focus()
}
Expand Down

0 comments on commit d6091d1

Please sign in to comment.