mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
22 lines
403 B
Vue
22 lines
403 B
Vue
<template>
|
|
<span :class="['van-tag', { [`van-tag--${type}`]: type, 'is-plain': plain, 'is-mark': mark }]">
|
|
<slot></slot>
|
|
</span>
|
|
</template>
|
|
|
|
<script>
|
|
const ALLOW_TYPE = ['danger', 'success', 'primary'];
|
|
|
|
export default {
|
|
name: 'van-tag',
|
|
props: {
|
|
type: {
|
|
type: String,
|
|
validator: val => ~ALLOW_TYPE.indexOf(val)
|
|
},
|
|
mark: Boolean,
|
|
plain: Boolean
|
|
}
|
|
};
|
|
</script>
|