Skip to content

Commit

Permalink
fix(tree-select): fix tree-select can't load data dynamically close #…
Browse files Browse the repository at this point in the history
  • Loading branch information
kagol authored Nov 12, 2024
1 parent e2cebe2 commit 9574b58
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/renderless/src/tree-select/vue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { filter, nodeClick, check } from './index'

export const api = ['state', 'filter', 'nodeClick', 'check']

export const renderless = (props, { reactive, computed }, { vm, emit }) => {
export const renderless = (props, { reactive, computed, watch }, { vm, emit }) => {
const api = {}

const state = reactive({
Expand All @@ -17,5 +17,11 @@ export const renderless = (props, { reactive, computed }, { vm, emit }) => {
check: check({ props, vm, emit })
})

watch(
() => props.treeOp.data,
(data) => data && (state.treeData = data),
{ immediate: true, deep: true }
)

return api
}

0 comments on commit 9574b58

Please sign in to comment.