I'm using TreeSelect from Sakai PrimeVUE template, I would like to keep all items expanded on open the component, but could not find this option in the documentation.
My TreeSelect implementation:
<TreeSelect v-model="product.category" :overlayVisible="true" selectionMode="single" :options="categories" @change="categoryChange(product)"></TreeSelect>
Info from my package.json:
"primevue": "^3.11.0",
"vue": "3.2.9",
TreeSelecthas a method namedexpandPath(path), wherepathis thekeyproperty in a tree node.To expand all nodes, collect all the keys from the tree nodes, and then pass each of them to
expandPath():<TreeSelect>to use it later in script:getKeysFromTree) to extract the keys from an array of tree nodes:onMounted()hook, use the template ref to callexpandPath()on each of the tree's keys (extracted withgetKeysFromTree()defined above):demo