Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

vue ref add class

methods: {
    onClick(ref) {
      const activeClass = 'active-submenu'
      if (!this.$refs[ref].classList.length) {
        this.$refs[ref].classList.value = [activeClass]
      } else {
        this.$refs[ref].classList.value = ''
      }
    },
  },
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #vue #ref #add #class
ADD COMMENT
Topic
Name
4+7 =