food_wechat/components/badge/badge.vue
sszdot c280d65a7a 【类 型】:feat
【原  因】:
【过  程】:样式调整
【影  响】:

# 类型 包含:
# feat:新功能(feature)
# fix:修补bug
# docs:文档(documentation)
# style: 格式(不影响代码运行的变动)
# refactor:重构(即不是新增功能,也不是修改bug的代码变动)
# test:增加测试
# chore:构建过程或辅助工具的变动
2024-12-20 17:16:35 +08:00

38 lines
593 B
Vue

<template>
<view v-if="cou!==0" class="badge bg-m fci flex mac mc rad-c" :style="{ right: offset[0] + 'rpx', top: offset[1] + 'rpx' }">
{{cou>99?99:cou}}
</view>
</template>
<script>
export default {
name: "badge",
data() {
return {};
},
computed: {
},
props: {
offset: {
type: Array,
default () {
return [-20, -16] // 默认值
}
},
cou: {
type: Number,
require: true
}
}
}
</script>
<style lang="scss" scoped>
.badge {
position: absolute;
width: 30rpx;
height: 30rpx;
font-size: 20rpx;
font-weight: normal;
}
</style>