UNPKG

magiccube-vue3

Version:

vue3-js版组件库

30 lines (27 loc) 669 B
const Label = { name: 'McLabel', props: { color: String, content: [String, Number], badge: Boolean }, emits: [], setup(props, { emit }){ return () => ( <div class={{ 'mc-label': true, [`mc-label__color--${props.color}`]: props.color, }}> <span v-html={props.content}></span> { props.badge? <i class="mc-label__badge"></i> : '' } </div> ) } } Label.install = Vue => { Vue.component(Label.name, Label) } const McLabel = Label export { McLabel, McLabel as default }