export default {
data() {
return {
limit:3,
goodsList:[
{
name:"Jim",
avatar:"http://wx.qlogo.cn/mmopen/vi_32/wX3AWPU4eSpW31C8lQXibOPjwS5tctxgmlSPpvROwSAu2jm8wQ7btoiayzpK37tYwtQXfohqOib2dI6tecMWoAIbQ/0"
},
{
name:"ice",
avatar:"http://wx.qlogo.cn/mmopen/vi_32/wX3AWPU4eSpW31C8lQXibOPjwS5tctxgmlSPpvROwSAu2jm8wQ7btoiayzpK37tYwtQXfohqOib2dI6tecMWoAIbQ/0"
},{
name:"Jace",
avatar:"http://wx.qlogo.cn/mmopen/vi_32/wX3AWPU4eSpW31C8lQXibOPjwS5tctxgmlSPpvROwSAu2jm8wQ7btoiayzpK37tYwtQXfohqOib2dI6tecMWoAIbQ/0"
},{
name:"Jboos",
avatar:"http://wx.qlogo.cn/mmopen/vi_32/wX3AWPU4eSpW31C8lQXibOPjwS5tctxgmlSPpvROwSAu2jm8wQ7btoiayzpK37tYwtQXfohqOib2dI6tecMWoAIbQ/0"
},{
name:"Tom",
avatar:"http://wx.qlogo.cn/mmopen/vi_32/wX3AWPU4eSpW31C8lQXibOPjwS5tctxgmlSPpvROwSAu2jm8wQ7btoiayzpK37tYwtQXfohqOib2dI6tecMWoAIbQ/0"
},{
name:"Lucy",
avatar:"http://wx.qlogo.cn/mmopen/vi_32/wX3AWPU4eSpW31C8lQXibOPjwS5tctxgmlSPpvROwSAu2jm8wQ7btoiayzpK37tYwtQXfohqOib2dI6tecMWoAIbQ/0"
},{
name:"Lilili",
avatar:"http://wx.qlogo.cn/mmopen/vi_32/wX3AWPU4eSpW31C8lQXibOPjwS5tctxgmlSPpvROwSAu2jm8wQ7btoiayzpK37tYwtQXfohqOib2dI6tecMWoAIbQ/0"
}
],
totalMoney:1478511
}
},computed:{
goodsListFilter(){
//通过计算属性 截取新数组大小
return this.goodsList.slice(0,this.limit);
}
},methods:{
// 点击更多展示其他数据
openMore(){
if(this.limit==3){
this.limit = this.goodsList.length
console.info(this.limit+"--this.limit");
}else{
this.limit=3
}
}
}
}