60 lines
1.0 KiB
Vue
60 lines
1.0 KiB
Vue
<template>
|
|
<view class="agree-radio" :style="{width:radioSize,height:radioSize}">
|
|
<image v-if="!isAgree"
|
|
:src="noImg"
|
|
class="agree-btn"
|
|
mode="aspectFit"
|
|
@click="changeAgree(true)" :style="{width:radioSize,height:radioSize}"></image>
|
|
<image v-else
|
|
:src="yesImg"
|
|
class="agree-btn"
|
|
mode="aspectFit"
|
|
@click="changeAgree(false)" :style="{width:radioSize,height:radioSize}"></image>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
name:"AgreeRadio",
|
|
props: {
|
|
// 是否显示返回按钮
|
|
isAgree: {
|
|
type: Boolean,
|
|
default: false
|
|
},
|
|
yesImg :{
|
|
type: String,
|
|
default: "/static/images/agree_y.png"
|
|
},
|
|
noImg :{
|
|
type: String,
|
|
default: "/static/images/agree_n.png"
|
|
},
|
|
radioSize:{
|
|
type: String,
|
|
default: "32rpx"
|
|
}
|
|
},
|
|
data() {
|
|
return {
|
|
|
|
};
|
|
},
|
|
methods: {
|
|
changeAgree(value) {
|
|
this.$emit('change-agree', value)
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
.agree-radio {
|
|
width: 32rpx;
|
|
height: 32rpx;
|
|
}
|
|
.agree-btn {
|
|
width: 32rpx;
|
|
height: 32rpx;
|
|
}
|
|
</style> |