I followed the steps, but it doesn't work



  • Re: [Solved] [V1] QTree does not expand all by property default-expand-all

    I followed the steps, but it doesn’t work

    <q-tree
          ref="tree"
          :nodes="computedNodes"
          node-key="nodeKey"
          color="secondary"
          default-expand-all
          :tick-strategy="tickStrategy"
          :ticked.sync="ticked"
          @update:selected="selectNode"
          :selected="selected"
        />
    
    async mounted() {
        var self = this;
    
        axiosInstance.get("Admin/Profile/GetActionItems").then(response => {
          self.nodes = response.data;
        });
        await self.$nextTick()
        self.$refs.tree.expandAll()
    
      },
    computed: {
        computedNodes() {
          return this.nodes.length > 0 ? this.nodes : [];
        }
      },
    


  • @eloy-silva

    Solved :

    🙂

    async mounted() {
        var self = this;
         await axiosInstance.get("Admin/Profile/GetActionItems").then(response => {
          self.nodes = response.data;
        });
        await self.$nextTick()
        self.$refs.tree.expandAll()
    
      },
    

Log in to reply