.vue 中
import { IMAudioManage} from "./IMKit.js"
<template>
<view>
<view v-for="(item, index) in chatList" :key="index">
<div class="content" @click="play(item)>
<div :class="['common', item.isPlaying ? 'big':'big_0']"></div>
<div :class="['common', item.isPlaying ? 'middle':'middle_0']"></div>
<div class="common min"></div>
</div>
</view>
</view>
<template>
method: {
play(messageModel){
IMAudioManage.playByMessage(messageModel)
}
}
IMKit.js中
const IMAudioManage = {
playByMessage(messageModel) {
messageModel.isPlaying = true
}
}
export { IMAudioManage}
0 个回复