index.vue
1.43 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<template>
<div v-if="type === 'primary'" class="button-primary" @click="handle">
<slot></slot>
</div>
<div v-if="type === 'plain'" class="button-plain" @click="handle">
<slot></slot>
</div>
<div v-if="type === 'custom'" :style="customStyle" class="button-custom" @click="handle">
<slot></slot>
</div>
</template>
<script setup>
import { ref, reactive, onMounted } from 'vue'
const props = defineProps({
type: String,
customStyle: Object
})
const emit = defineEmits(['on-click']);
const handle = () => {
emit('on-click', '')
}
onMounted(() => {
})
</script>
<script>
export default {
data () {
return {
}
},
mounted () {
},
methods: {
}
}
</script>
<style lang="less" scoped>
.button-primary {
width: auto;
height: auto;
text-align: center;
padding: 0.6rem;
margin: 0.5rem;
font-size: 1rem;
background: @base-color;
border-radius: 24px;
border: 1px solid @base-color;
color: #713610;
font-weight: bold;
}
.button-plain {
width: auto;
height: auto;
text-align: center;
padding: 0.6rem;
margin: 0.5rem;
font-size: 1rem;
background: #FFFFFF;
border-radius: 24px;
border: 1px solid #713610;
color: #713610;
font-weight: bold;
}
.button-custom {
width: auto;
height: auto;
text-align: center;
padding: 0.6rem;
font-size: 1rem;
border-radius: 24px;
border: 1px solid;
}
</style>