当前位置:编程学习 > JS >>

vue 中this.后面加一个变量

用this[变量名]


<view :data-value="yzt" @tap="yizuotu($event,'yizuotu')">易做图</view>


yizuotu(e,t){

this[t]=e.currentTarget.dataset.value;

}

CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,