父组件index.vue
<hot v-on:addgame="addgame" ref="childMethod"></hot>
子组件hot.vue
<template name="hot">
<view class="Content">
<view class="_title">
<span class="_span"></span>
<text class="_text">传奇热门推荐</text>
</view>
<view class="_footer">
<view class="_item" v-for="(item,index) in hotList" :key="item.id">
<view class="_left">
<image class="_image" :src="item.icon" mode=""></image>
</view>
<view class="_center">
<text class="_textTop">{{item.game_name}}</text>
<text class="_textCenter">{{item.play_count}}人在玩</text>
<text class="_textFooter">{{item.features}}</text>
</view>
<view class="_right">
<text class="_text" @tap="addgame">开始玩</text>
</view>
</view>
</view>
</view>
</template>
0 个回复