phphe / he-tree-vue

A draggable sortable vue tree component, with dragging placeholder, types definition.
https://hetree.phphe.com/
136 stars 21 forks source link

Multiple `foldingTransition` warnings #42

Open AndreasNasman opened 3 years ago

AndreasNasman commented 3 years ago

Adding a Tree with v-slot results in multiple foldingTransition warnings. Is this the correct way to customize how the tree is displayed with Vue 3? https://he-tree-vue.phphe.com/guide.html#custom-display-through-default-slot image

Here's a minimal implementation of the problem, adding the Tree to a HelloWorld component built with the Vue Cli:

<template>
  <Tree :value="treeData" v-slot="{ node, index, path, tree }">
    <span>
      <b>{{ index }}</b>
      Title: {{ node.title }} - path: <i>{{ path.join(",") }}</i>
    </span>
  </Tree>
  ...
</template>

<script>
import { Tree } from "he-tree-vue";

export default {
  ...
  components: { Tree },
  data() {
    return {
      treeData: [
        { title: "node 1" },
        { title: "node 2", children: [{ title: "node 2-1" }] },
      ],
    };
  },
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
...
</style>
phphe commented 3 years ago

foldingTransition belongs to fold plugin. You can mixin fold plugin in your use.

AndreasNasman commented 3 years ago

How come the warnings show up even though I'm not using the plugin? I don't intend to either. Shouldn't the warnings be suppressed by default, i.e. not using the plugin?