vue-tree icon indicating copy to clipboard operation
vue-tree copied to clipboard

tpl method gives error in laravel

Open jsinhSolanki opened this issue 5 years ago • 2 comments

Hello, Thanks for great tree component. I used your demo for laravel project. I copied this code, and pasted in my laravel project. This is giving me error in my laravel project as follow.

  134 |       let titleClass = node.selected ? 'node-title node-selected' : 'node-title'
  135 |       if (node.searched) titleClass += ' node-searched'
> 136 |       return <span>
      |              ^
  137 |         <span class="tree-expand" onClick={() => this.$refs.tree.addNode(node, {title: 'sync node'})}>+</span>
  138 |          <span class={titleClass} domPropsInnerHTML={node.title} onClick={() => {
  139 |            this.$refs.tree.nodeSelected(node)
    at Parser.raise 

However above code works fine if I only use VueJS. Can you please help me with this.

~ Thanks

jsinhSolanki avatar Jul 18 '19 06:07 jsinhSolanki

it’s a shame, mainly because we are not familiar with PHP, so i don't know how to install the corresponding plugin(maybe, etc transform-vue-jsx) to supprot syntax of jsx, ([email protected]), it my email ,if you need further communication, can contact me.

halower avatar Jul 18 '19 08:07 halower

Maybe a little late I have same problem with same environment using Laravel and Vue2 finally here is my workaround

<v-tree ref="tree"
                :canDeleteRoot="false"
                :data="treeData2"
                :draggable="true"
                :multiple="true" 
                :tpl="tpl"                  <<<<<< do not use tpl
/>

Put your html code inside your tree data

title: 'node 1-1-3 <h1>title</h1>'

This require you deal with your tree data first.

5SMNOONMS5 avatar Nov 12 '20 11:11 5SMNOONMS5