This article describes in detail how to use the Vue. js component tree to implement an infinitely-level tree menu code, which has some reference value. Interested friends can refer to this article for reference.
And
- The code for implementing tree using tags may not be well written. If you have better hopes, share them.
The Code is as follows:Html code:
- {{item.text}}
- {{item.text}}
Js Code:
Methods: {toggleChildren: function (item) {item. expanded =! Item. expanded ;},}, data () {return {menus: [{text: 'fruit ', expanded: false, children: [{text: 'apple ',}, {text: 'lychee '}, {text: 'Grape'}, {text: 'Dragon go'}]}, {text: 'delicious ', expanded: false, children: [{text: 'tang' ,},{ text: 'bread' },{ text: 'hams '},{ text: 'potato chips' },{ text: 'Broken noodle '}]}, {text: 'beverage', expanded: false, children: []},
:
The above is all of the content in this article. I hope it will be helpful for everyone's learning and support for PHP's Chinese Web.
For more articles about Vue. js component tree implementation of an infinitely hierarchical tree menu, refer to PHP!