Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. methods: {
  2. initTab: function(){
  3. document.querySelectorAll('.element').onclick = this.nextTab()
  4. }
  5. },
  6. mounted: function () {
  7. this.initTab()
  8. }
  9.  
  10. <component-name @click="nextTab(tabName)"></component-name>
  11.  
  12. <ul v-for="tab in tabs">
  13. <li @click="nextTab(tab)">{{tab}}</li>
  14. </ul>
  15.  
  16. methods: {
  17. nextTab: function(tab){
  18. // whatever it is you want to do here
  19. }
  20. },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement