UNPKG

@ccos/webos-vue

Version:

A Web-Ui Framework for Skyworth/Coocaa TV

55 lines (54 loc) 1.44 kB
import { ref, withDirectives, openBlock, createElementBlock, normalizeClass, createElementVNode, toDisplayString, vShow } from "vue"; import "./index37.mjs"; import _export_sfc from "./index34.mjs"; const _sfc_main = { __name: "toast", props: { size: { type: String, default: "default" }, content: String, shadow: Boolean, //是否有阴影,有阴影的背景色为gray6,无的为gray7 bottom: Boolean, //是否在底部 time: { type: Number, default: 3e3 } }, setup(__props, { expose: __expose }) { const props = __props; const isShow = ref(false); const show = () => { isShow.value = true; if (props.time >= 0) { setTimeout(() => { hide(); }, props.time); } }; const hide = () => { isShow.value = false; }; __expose({ show }); return (_ctx, _cache) => { return withDirectives((openBlock(), createElementBlock("div", { class: normalizeClass([[__props.shadow ? "is-shadow" : "", __props.bottom ? "is-bottom" : ""], "tv-toast"]) }, [ createElementVNode("div", { class: normalizeClass(__props.size) }, toDisplayString(__props.content), 3) ], 2)), [ [vShow, isShow.value] ]); }; } }; const Toast = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-9aaa76ac"]]); export { Toast as default };