function

  • When you first go into this screen it’s going to show us one level of content and click on one level and click on two levels to show you the next level of content
  • If there’s a subset there’s a little arrow down there if there’s no subset there’s no little arrow down there so that’s a detail
  • When you click to expand all the subsets when you click again to close and then you click again to expand all the subsets at once on our page

Performance optimization

  • We require that our first screen rendering time is at least one of the shortest If there is some hidden pictures or video in the user does not have to open cases It will bring these resources loaded in the user experience is not very good for us For the first time into the interface is advantage of caton We use the other is the value of the control to render To write an array It’s going to show us if you’ve shown it before and it’s not going to render if you haven’t shown it before

Knowledge points used

  • How does VUE modify the value of an object in an array

    • Data changes based on index values cannot be detected in vUE
    • $this.$set(target, key, value); $this.$set(target, key, value)
    • It can also be modified using methods defined by arrays
  • Why should the data in VUE component data return

    var data = function() {
        return {
            name: "zhangsan",
            age: 20
        }
    }
    var a = data();
    var b = data();
    a.age = 18;
    console.log(b);
    Copy the code
    • In JS, only functions have scope. When data is a function, each component instance has its own scope. Each instance is independent of each other and does not affect each other.
  • V-if is different from V-show

    • V-show is just changing the CSS style of the element, that is, the display attribute value. The element is always in the Dom tree, which has a higher initial rendering cost and is suitable for frequent switching.
    • V-if directly deletes or reconstructs element nodes from the Dom tree according to the true or false values of subsequent data, which has higher switching consumption and is not suitable for frequent switching.
  • Font face usage method

Effect of picture

Project source welcome start

Github.com/cxuhwiuefhu…

Your “like” is my motivation for continuous output. I hope it can help us learn from each other. If you have any questions, please leave a message below