UNPKG

birdpaper-ui

Version:

一个通用的 vue3 UI组件库。A common vue3 UI component library.

34 lines (33 loc) 838 B
"use strict"; const vue = require("vue"); const birdpaperIcon = require("birdpaper-icon"); const _sfc_main = vue.defineComponent({ name: "Tag", props: { /** 标签图标 */ icon: { type: Object }, status: { type: String, default: "normal" }, dot: { type: Boolean, default: false }, closeable: { type: Boolean, default: false } }, components: { IconCloseLine: birdpaperIcon.IconCloseLine }, emits: ["close"], setup(props, { emit, slots }) { const name = "bp-tag"; const cls = vue.computed(() => { return [name, props.dot ? `${name}-dot-box` : `${name}-${props.status}`]; }); const handleClose = () => { if (!props.closeable) return; emit("close"); }; return { name, cls, slots, handleClose }; } }); module.exports = _sfc_main;