title: Passing data property as function argument in vue.js
body: <p>Instead of having few methods that look like:</p>
  
  <pre><code>showDiv1(){ 
      this.showDiv1 = true
  },
  showDiv2(){ 
      this.showDiv2 = true
  }
  </code></pre>
  
  <p>I am trying to create one like:</p>
  
  <pre><code>showElements(...elementNames){
       elementNames.forEach(name =&gt; {
             this.$data.name = true
       })
  }
  </code></pre>
  
  <p>The idea was to pass one or few properties from data and when calling the method those elements would should up on screen.</p>
  
  <p>In data I have something like this:</p>
  
  <pre><code>  data() {
        return {
             div1 = false,
             div2 = false
        }
    }
  </code></pre>
  
  <p>In html I tried to call the function on click in a couple of ways:</p>
  
  <pre><code>  &lt;button @click="showElements('div1')"&gt;Show&lt;button&gt;
    &lt;button @click="showElements(div1)"&gt;Show&lt;button&gt;
    &lt;div v-if="div1"&gt;
         &lt;p&gt;Hello&lt;/p&gt;
    &lt;/div&gt;    
  </code></pre>
  
  <p>But nothing happens.</p>