如果想在方法传参中给this.code
赋值
//发送验证码
data(){
return{
code:'',
}
},
methods:{
sendCode(){
this.getCode('code');
},
getCode(name){
this[name]=············; //进行赋值
}
}
如果想在方法传参中给this.code
赋值
//发送验证码
data(){
return{
code:'',
}
},
methods:{
sendCode(){
this.getCode('code');
},
getCode(name){
this[name]=············; //进行赋值
}
}
本文标题:Vue中如何方法传参给data赋值
本文链接:https://www.haomeiwen.com/subject/oappwctx.html
网友评论