switchcat/src/pages/index/index.vue
2021-12-13 20:15:43 +08:00

64 lines
1.2 KiB
Vue

<template>
<view class="container">
<uni-list>
<uni-list-item v-for="item in games" >
<big-img-cell :g-data="item" v-on:cellClicked = 'onClick'></big-img-cell>
</uni-list-item>
</uni-list>
</view>
</template>
<script lang="ts">
import { Component, Vue } from 'vue-property-decorator'
import BigImgCell from '@/components/BigImgCell/index.vue'
import { IGameInfo } from '@/modules/gameinfo'
@Component({
name: 'Index',
components: {
BigImgCell
}
})
export default class extends Vue{
private games: IGameInfo[] = []
onLoad() {
for (let i = 0; i < 10; i++) {
this.games.push({
gameId: i + '',
banner: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/094a9dc0-50c0-11eb-b680-7980c8a877b8.jpg',
name: '测试游戏' + i,
ename: 'test game ' + i
})
}
}
onClick(e: any) {
uni.navigateTo({
url: '/pages/info/index',
animationType: 'pop-in',
animationDuration: 200})
}
actionsClick(text: string) {
uni.showToast({
title: text,
icon: 'none'
})
}
}
</script>
<style>
.container {
overflow: hidden;
}
big-img-cell {
width: 100%;
}
</style>