ant a-tree-select sets the default expanded node

directly on the code

     <a-tree-select
              show-search
              v-model="form.goods_type"
              tree-node-filter-prop="title"
              style="width: 100%"
              :dropdown-style="{
                maxHeight: '400px',
                overflowY: 'auto',
                width: '85%',
                minWidth: '',
              }"
              :tree-data="treeData"
              placeholder="请选择"
              :treeDefaultExpandedKeys="treeDefaultExpandedKeys"
              :getPopupContainer="
                triggerNode => {
                  return triggerNode.parentNode;
                }
              "
            >
            </a-tree-select>

:treeDefaultExpandedKeys="treeDefaultExpandedKeys"

This line is the key

You can declare it in data , and you can write strings or numeric values ​​in it.

 treeDefaultExpandedKeys: ['key值'],

Guess you like

Origin blog.csdn.net/slow097/article/details/126507979