I have a general function func, to change the value of variables in data, but can"t variables in data be passed to the function as arguments?
<template>
<div>
<button @click="click1">btn1</button>
<button @click="click2">btn2</button>
</div>
</template>
<script>
import card1 from ***
import card2 from ***
data () {
return {
card1,
card2
}
},
method: {
click1 () {
this.func(this.card1)
}
click2 () {
this.func(this.card2)
}
//
func (card) {
card = "***"
}
}
</script>