centerLine.vue
884 字节
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
<template>
<view class="centerLine" :style="{color: fontColor}">
<text @click="leftComfirn">{{ leftContent }}</text>
<text class="line" :style="{backgroundColor: fontColor}"></text>
<text @click="rightComfirn">{{ rightContent }}</text>
</view>
</template>
<script setup>
const props = defineProps({
fontColor: {
type: String,
default: '#3680FE'
},
leftContent: {
type: String,
default: '修改车辆信息'
},
rightContent: {
type: String,
default: ''
},
})
const emit = defineEmits(['leftComfirn', 'rightComfirn'])
// 修改车辆信息
const leftComfirnButton = () => {
emit('leftComfirn')
}
// 删除车辆信息
const rightComfirnButton = () => {
emit('rightComfirn')
}
</script>
<style lang="scss" scoped>
.centerLine{
display: flex;
align-items: center;
font-size: 20rpx;
.line{
height: 20rpx;
width: 2rpx;
margin: 0 20rpx;
}
}
</style>