Vue-treeselect 父子关系不强关联设置?

vue-treeselect 树形选择组件,如何让父子关系不强关联,比如:选中父节点,子节点不选中,选中子节点,父节点补选中?

如何设置不强关联


回答:

官网就有一个:

<div>

<treeselect

:multiple="true"

:options="options"

:flat="true"

:sort-value-by="sortValueBy"

:default-expand-level="1"

placeholder="Try selecting some options."

v-model="value"

/>

<treeselect-value :value="value" />

<p><strong>Sort value by:</strong></p>

<p class="options">

<label><input type="radio" value="ORDER_SELECTED" v-model="sortValueBy">Order selected</label>

<label><input type="radio" value="LEVEL" v-model="sortValueBy">Level</label>

<label><input type="radio" value="INDEX" v-model="sortValueBy">Index</label>

</p>

</div>

import { generateOptions } from './utils'

export default {

data() {

return {

value: [ 'c', 'aaa', 'bb' ],

options: generateOptions(3),

sortValueBy: 'ORDER_SELECTED',

}

},

}

https://vue-treeselect.js.org/#flat-mode-and-sort-values

以上是 Vue-treeselect 父子关系不强关联设置? 的全部内容, 来源链接: utcz.com/p/935230.html

回到顶部