generated from thzxcx/vue3
chore: tag增加圆角参数
This commit is contained in:
@ -1,8 +1,8 @@
|
|||||||
<!--
|
<!--
|
||||||
* @Author: peerless_hero peerless_hero@outlook.com
|
* @Author: peerless_hero peerless_hero@outlook.com
|
||||||
* @Date: 2023-07-11 02:12:08
|
* @Date: 2023-07-11 02:12:08
|
||||||
* @LastEditors: zhaojinfeng 121016171@qq.com
|
* @LastEditors: Hefeng 1057605508@qq.com
|
||||||
* @LastEditTime: 2023-11-16 12:32:51
|
* @LastEditTime: 2024-01-16 12:59:41
|
||||||
* @FilePath: \uni\packages\tag\index.vue
|
* @FilePath: \uni\packages\tag\index.vue
|
||||||
* @Description:
|
* @Description:
|
||||||
*
|
*
|
||||||
@ -20,7 +20,6 @@
|
|||||||
font-500
|
font-500
|
||||||
border-2rpx
|
border-2rpx
|
||||||
border-solid
|
border-solid
|
||||||
rd-8rpx
|
|
||||||
>
|
>
|
||||||
{{ text }}
|
{{ text }}
|
||||||
</text>
|
</text>
|
||||||
@ -31,7 +30,8 @@ import { computed } from 'vue'
|
|||||||
|
|
||||||
const props = withDefaults(
|
const props = withDefaults(
|
||||||
defineProps<{
|
defineProps<{
|
||||||
/** 类型 */
|
radius?: boolean
|
||||||
|
/** 类型 */
|
||||||
type?: 'default' | 'primary' | 'danger' | 'warning' | 'success' | 'info'
|
type?: 'default' | 'primary' | 'danger' | 'warning' | 'success' | 'info'
|
||||||
/** 显示文本 */
|
/** 显示文本 */
|
||||||
text?: string
|
text?: string
|
||||||
@ -40,22 +40,24 @@ const props = withDefaults(
|
|||||||
}>(),
|
}>(),
|
||||||
{
|
{
|
||||||
type: 'default',
|
type: 'default',
|
||||||
|
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
const className = computed(() => {
|
const className = computed(() => {
|
||||||
const bg = props.plain ? '' : ' bgc'
|
const bg = props.plain ? '' : ' bgc'
|
||||||
|
const rd = props.radius ? ' rd-full' : ' rd-8rpx'
|
||||||
switch (props.type) {
|
switch (props.type) {
|
||||||
case 'danger':
|
case 'danger':
|
||||||
return `th-tag-danger${bg}`
|
return `th-tag-danger${bg} ${rd}`
|
||||||
case 'primary':
|
case 'primary':
|
||||||
return `th-tag-primary${bg}`
|
return `th-tag-primary${bg} ${rd}`
|
||||||
case 'warning':
|
case 'warning':
|
||||||
return `th-tag-warning${bg}`
|
return `th-tag-warning${bg} ${rd}`
|
||||||
case 'success':
|
case 'success':
|
||||||
return `th-tag-success${bg}`
|
return `th-tag-success${bg} ${rd}`
|
||||||
default:
|
default:
|
||||||
return `th-tag-default${bg}`
|
return `th-tag-default${bg} ${rd}`
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
Reference in New Issue
Block a user