index.nvue
<template>
<view>
<view class="btn a" hover-class="b" @click="test">
</view>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
test() {
console.log('click!')
}
}
}
</script>
<style>
.btn {
width: 750rpx;
height: 200rpx;
}
.a {
background-color: #f00;
}
.b {
background-color: #0f0;
}
</style>
1 个回复
DCloud_UNI_Anne
感谢您的反馈!
相关问题帖子:https://ask.dcloud.net.cn/question/122455