Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- methods: {
- initTab: function(){
- document.querySelectorAll('.element').onclick = this.nextTab()
- }
- },
- mounted: function () {
- this.initTab()
- }
- <component-name @click="nextTab(tabName)"></component-name>
- <ul v-for="tab in tabs">
- <li @click="nextTab(tab)">{{tab}}</li>
- </ul>
- methods: {
- nextTab: function(tab){
- // whatever it is you want to do here
- }
- },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement