75 lines
1.7 KiB
Vue
75 lines
1.7 KiB
Vue
<template>
|
|
<div
|
|
class="custom-btn"
|
|
:class="[
|
|
props.isBottom ? 'custom-btn-bottom' : '',
|
|
props.subBtnText ? 'apposition-btn-style' : '',
|
|
]"
|
|
>
|
|
<wd-button custom-class="custom-sub-btn-class" v-if="props.subBtnText">
|
|
{{ props.subBtnText }}
|
|
</wd-button>
|
|
<wd-button custom-class="custom-btn-class" @click="clickBtn">
|
|
{{ props.btnText }}
|
|
</wd-button>
|
|
</div>
|
|
</template>
|
|
<script setup>
|
|
import { reactive } from 'vue'
|
|
import { defineProps, defineEmits } from 'vue'
|
|
const state = reactive({})
|
|
const emits = defineEmits(['clickBtn'])
|
|
const props = defineProps({
|
|
isBottom: false, //是否底部按钮
|
|
btnText: '', //按钮文字
|
|
subBtnText: '', //次要按钮文字
|
|
})
|
|
|
|
//点击
|
|
const clickBtn = () => {
|
|
emits('clickBtn')
|
|
}
|
|
</script>
|
|
<style scoped lang="scss">
|
|
.custom-btn {
|
|
display: flex;
|
|
flex-direction: row;
|
|
align-items: center;
|
|
justify-content: center;
|
|
.custom-sub-btn-class {
|
|
background-color: #eee9f8;
|
|
padding: 18rpx 185rpx;
|
|
border-radius: 8rpx;
|
|
box-shadow: 0 6px 12px 2px rgba(188, 188, 188, 0.08);
|
|
font-size: 28rpx;
|
|
font-weight: 500;
|
|
line-height: 40rpx;
|
|
color: $theme-primary;
|
|
}
|
|
.custom-btn-class {
|
|
background-color: $theme-primary;
|
|
padding: 18rpx 185rpx;
|
|
border-radius: 8rpx;
|
|
box-shadow: 0 6px 12px 2px rgba(188, 188, 188, 0.08);
|
|
font-size: 28rpx;
|
|
font-weight: 500;
|
|
line-height: 40rpx;
|
|
}
|
|
}
|
|
.custom-btn-bottom {
|
|
width: 100%;
|
|
background-color: #fff;
|
|
padding: 14rpx 0 72rpx;
|
|
}
|
|
.apposition-btn-style {
|
|
padding: 14rpx 30rpx 72rpx;
|
|
.custom-sub-btn-class {
|
|
padding: 18rpx 124rpx;
|
|
margin: 0 20rpx 0 0;
|
|
}
|
|
.custom-btn-class {
|
|
padding: 18rpx 124rpx;
|
|
}
|
|
}
|
|
</style>
|