data:{
title:[
{name:'买入',id:'0',iscur:true},
{name:'卖出',id:'1',iscur:false},
{name:'Push',id:'2',iscur:false},
{name:'抵押',id:'3',iscur:false},
{name:'交易',id:'4',iscur:false},
]}
methods:{
setCur: function (index) {
index.currentTarget;
this.title.map(function (v,i) {
i==index? v.iscur=true: v.iscur=false;
});
}
}
vue.js methods 调用函数 $index is not defined
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
vue2?
index-and-key-移除
改成类似
这种样子的吧
vue2.0移除了$index

请用这种方法传递index