pad-app/pages/test.vue

144 lines
2.3 KiB
Vue

<template>
<view class="container">
<custom-waterfalls-flow :value="data.list" class="custom">
<template v-slot:default="item">
<view class="del" @click="del(item.index)">
</view>
<view class="desc" v-for="(ele,index2) in item.desc" :key="index2">
{{
ele.a
}}
</view>
</template>
</custom-waterfalls-flow>
<button @click="toOne">1</button>
<button @click="totne">2</button>
<button @click="toYne">3</button>
</view>
</template>
<script>
import {
mapActions
} from 'vuex'
export default {
components: {
},
data() {
return {
isMember: '-1', // 判断用户登录状态 -1为从未进来过 0 为申请注册还未审批 1为申请成功已经是会员 4为申请拒绝
data: {
list: [{
image: '/static/images/cwJl.png',
title: '哈哈啊哈哈哈',
desc: [{
a: 1
},
{
a: 2
}
]
},
{
image: '/static/images/cwTop16.png',
title: '哈哈啊哈哈哈',
desc: [{
a: 3
},
{
a: 4
}
],
},
{
image: '/static/images/logo.png',
title: '哈哈啊哈哈哈',
desc: [{
a: 6
},
{
a: 9
}
]
}
]
}
}
},
onLoad(e) {
},
onShow() {
},
methods: {
...mapActions([
'majax',
'najax',
'jajax',
'goout'
]),
toYne() {
this.data.list.push({
image: '/static/images/cwJl.png',
title: '哈哈啊哈哈哈',
desc: [{
a: 1
},
{
a: 2
}
]
})
},
toGo(i) {
this.data.list[i].desc.push({
a: i
})
},
del(i) {
console.log(i);
this.data.list.splice(i, 1);
console.log(this.data.list);
},
toOne() {
this.data.list.push({
image: '/static/images/cwTop16.png',
title: '哈哈啊哈哈哈',
desc: [{
a: 1
},
{
a: 2
}
]
})
},
totne() {
this.data.list.push({
image: '/static/images/logo.png',
title: 'wadapkdop啊哈哈哈',
desc: [{
a: 1
},
{
a: 2
}
]
})
}
}
}
</script>
<style lang="less" scoped>
.item {
height: auto;
}
.custom image {
display: none;
}
</style>