Vue js Add active class to current Navigation Menu

Vue js Add active class to current Navigation Menu

In this Post We Will Explain About is Vue js Add active class to current Navigation Menu With Example and Demo.Welcome on infinityknow.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to add active class onclick Vue js Example

In this post we will show you Best way to implement Vue js add active class to current page, hear for How to Add Active Class to a Navigation Menu Based vuejs with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

READ :  Points to Keep in Mind While Installing Ethernet Cable

Vue js active class on click

In this Example,First of all Add or Inluce External Libs Like as a(jQuery, css etc..), and then create a simple index.php or index.html page.After that crate a simple javascript file like as a index.js or main.js, It is also add your web-application First Header Part to some priorty set.After that Include your relavant CSS Class.

External Libs

[php]
https://unpkg.com/vue/dist/vue.js
[/php]

index.html

[php]

  • {{title}}

    {{content}}

  • [/php]

    index.js

    [php]
    new Vue({
    el: ‘#liveApp’,
    data: {
    items: [
    {title: ‘Home’, content: ‘Content 1’},
    {title: ‘About’, content: ‘Content 2’}
    ],
    activeLiIndex: null
    },
    components: {
    ‘live-menu-list’: {
    template: ‘#live-menu-list’,
    props: [‘title’, ‘content’, ‘active’, ‘index’],
    methods: {
    livetoggleClass() {
    this.$emit(‘newactive’, this.index);
    }
    }
    }
    }
    });

    READ :  Show And Hide vue js v-if multiple Conditions

    [/php]

    style.css

    [php]
    .active {
    background-color: blue;
    }
    [/php]

    You are Most welcome in my youtube Channel Please shubscibe my channel. and give me feedBackMore Details……
    Angularjs Example

    Example

    I hope you have Got What is vue js Change active class when link is selected And how it works.I would Like to have FeaeBack From My Blog(infinityknow.com) readers.Your Valuable FeedBack,Any Question,or any Comments abaout This Article(infinityknow.com) Are Most Always Welcome.

    Leave a Comment