search

Home  >  Q&A  >  body text

Vue v-for a click event not working - Stack Overflow

<template>
<p class="mainPanel page-app">
<p class="jk-box">
<ul>
        <li v-for="x in list"  ><a id="dangwuzhinan" @click.native="change">{{x.name}}</a></li>
</ul>
</p>
</p>
</template>
<script>
export default {
  name:"app",
  data () {
      return {
         list:[
            {name:"3333333333333"},
            {name:"2222222222"},
            {name:"11111111"}
            ],
          
      }
  },
  methods:{
    change: function() {
    
      console.log("aaa")
    }
  }
}

Please give me some advice...I won’t report an error either

伊谢尔伦伊谢尔伦2742 days ago1334

reply all(1)I'll reply

  • 黄舟

    黄舟2017-07-05 11:04:44

    You can refer to this =》Answer

    reply
    0
  • Cancelreply