UNPKG

birdpaper-ui

Version:

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

40 lines (39 loc) 1.07 kB
"use strict"; const vue = require("vue"); const birdpaperIcon = require("birdpaper-icon"); const _sfc_main = vue.defineComponent({ name: "Alert", props: { type: { type: String, default: "info" }, title: { type: String, default: "" }, closeable: { type: Boolean, default: false } }, emits: ["close"], components: { IconCloseLine: birdpaperIcon.IconCloseLine }, setup(props, { emit, slots }) { const name = "bp-alert"; const iconType = { success: birdpaperIcon.IconCheckboxCircleFill, error: birdpaperIcon.IconCloseCircleFill, warning: birdpaperIcon.IconErrorWarningFill, loading: birdpaperIcon.IconLoader5Line }; const cls = vue.computed(() => { return [name, `${name}-${props.type}`, props.title ? `${name}-with-title` : ""]; }); const isRender = vue.ref(true); const handleClose = () => { isRender.value = false; emit("close"); }; return { name, cls, iconType, isRender, handleClose, slots }; } }); module.exports = _sfc_main;