How does vue call the @ click event that the function gives to button from v-for

The

click event cannot call the function dynamically. The error is as follows:
TypeError: _ vm.func is not a function
what can I do to dynamically call the function from the v-for to the click event?

         <template slot-scope="scope">
            <el-button v-for="(item,key) in actionbutton" :key="key" :type="item.type" 
              :size="item.size"
              @click="func(item.value)">
             {{ item.label }}
            </el-button>
         </template>
          actionbutton: [
            {label: "", type: "text", value: "showDetails", size: "mini"},
            {label: "", type: "primary", value: "showEditDialog(scope.$index,scope.row)", size: "mini"},
            {label: "", type:"danger", value:"Delfunction(scope.$index,scope.row)", size: "mini"},
          ],
Jun.27,2021

I don't know if you wrote the following code in js? If not, it will be wrong.

methods: {
  func(val) {
    // 
  },
}

your value is just a string. How could it be implemented?


problem solved,
change value in actionbutton to method,.

method: (index, row) => {
     this.showEditDialog(index,row)
}

No? It doesn't exist. TypeError: _ vm.func is not a function this sentence is the cause of the error, not the problem you think it is.
http://jsfiddle.net/eywraw8t/.


check whether your component is a functional component
< template functional >
if yes, remove it and change it to a normal component

.
Menu