Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

270
Visualizações
liquor-tree using before returns TypeError: Cannot read properties of undefined (reading 'indexOf')

using "vue": "^2.6.12", "liquor-tree": "^0.2.70"

attempting to append to tree in lifecycle hook 'created()'. Dom appears to be loaded and it appears that I have a good reference to the object, receiving "TypeError: Cannot read properties of undefined (reading 'indexOf')

from the docs at https://amsik.github.io/liquor-tree/#Tree-API Tree.before(criteria, node) Usage: This method has behaviour the same as Tree.append, but the point of insertion will be different (before found node or the start of the list (as root)).

There's just not a whole lot of working examples for liquor-tree or info on the web, any help? thank you

(I've added the entry to the tree via javascript but im not getting the typical reactivity that I assume I might get if I add it to the tree using the api)

 <tree
      v-if="loaded"
      ref="layerTree"
      class="flex-fill"
      :data="platformTree"
      :options="treeOptions"
      :filter="filter"
      @node:checked="toggleVisibility"
      @node:unchecked="toggleVisibility"
    >
      <span class="tree-text" slot-scope="{ node }">
        <template v-if="node.data.icon">
          <i :class="node.data.icon"></i>
          {{ node.text }}
        </template>

        <template v-else>
          {{ node.text }}
        </template>
      </span>
    </tree>

and then

 updated() {
    console.log("this.$refs.layerTree ", this.$refs.layerTree);
    this.appendData();
  },
  methods: {
    async appendData() {
      this.$refs.layerTree.before(
        { text: "IDENTIFICATION" }, // search criteria
        "New CHILD Node for My super Text" // this string will be converted to Node object with default state parameters
      );

enter image description here

enter image description here

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda