RT。
现在是页面有几十个类似的button存在,但button的text内容不一样。

6666奶福
- 发布:2019-12-31 10:51
- 更新:2020-01-06 17:21
- 阅读:5465


<template>
<view class="content">
<view class="text-area">
<block v-for="item in list" :key="item">
<button type="default" @tap="getValue(item)">{{item}}</button>
</block>
</view>
</view>
</template>
<script>
export default {
data() {
return {
list: ["text1","text2","text3"]
}
},
onLoad() {
},
methods: {
getValue(value){
console.log(value)
}
}
}
</script>