myButton.vue
1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<template>
<view class="my_button" :class="{border, size: size === 'small'}" :style="{background: bgColor, color}" @click="comfirn">
{{ title }}
</view>
</template>
<script>
export default {
props: {
title: {
type: String,
require: true
},
color: {
type: String,
default: '#fff'
},
size: {
type: String,
default: 'normal'
},
bgColor: {
type: String,
default: ''
},
border: {
type: Boolean,
default: false
}
},
methods: {
comfirn(){
this.$emit('comfirn')
}
}
}
</script>
<style lang="scss" scoped>
.my_button{
box-sizing: border-box;
background: linear-gradient( 270deg, $uni-color-primary 0%, #FCD723 100%);
border-radius: 112rpx;
text-align: center;
line-height: 80rpx;
color: #fff;
font-size: 28rpx;
&.border{
border: 2rpx solid $uni-color-primary;;
}
}
.size{
padding: 8rpx 34rpx;
text-align: center;
color: #fff;
font-size: 24rpx;
line-height: 40rpx;
background: linear-gradient( 270deg, $uni-color-primary 0%, #FCD723 100%);
border-radius: 112rpx;
box-sizing: border-box;
}
</style>