Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize the effect of Tab Navigation by vue2.0

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you how vue2.0 to achieve tab navigation effect, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to understand it!

The details are as follows

1: the background is an e-commerce website on the web side, which presents different kinds of goods according to the navigation tab clicked. First of all, my routing structure is that navigation is a component, and the content of the tab is a separate component.

This is the content of the navigation component. Here, the navigation is mainly generated through the v-for loop. There is nothing to say. It is important to note that because the tab needs to know which module the user clicked on, there is a typeId attribute in the data. Here, you need to pass the value of this property to the tab component.

{{nav.title}} export default {data () {return {navs: [{title: "Home", path:'/home/second', typeId:'1', className:'currLi'} {title: "men's wear", path:'/home/second', typeId:'2'}, {title: "women's wear", path:'/home/second', typeId:'3'} {title: "Children's clothing", path:'/home/second', typeId:'4'}]}}, methods: {seeClothes (event) {var el=event.currentTarget Var type=el.getAttribute ("id"); var a = []; var p = el [XSS _ clean] .children; for (var I = 0meme pl= p.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report