UNPKG

@cqmcui/cqmcui

Version:

轻量级移动端 Vue2、Vue3 组件库(支持小程序开发)

121 lines (120 loc) 3.65 kB
import { computed, provide, resolveComponent, openBlock, createBlock, normalizeStyle, withCtx, createElementVNode, normalizeClass, createElementBlock, toDisplayString, renderSlot } from "vue"; import { c as createComponent } from "./component-81a4c1d0.js"; import { P as Popup } from "./index-c55ad69e.js"; import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js"; import "../locale/lang"; import "./Overlay.js"; import "@cqmcui/icons-vue"; const { componentName, create, translate } = createComponent("time-select"); const _sfc_main = create({ components: { [Popup.name]: Popup }, props: { visible: { type: Boolean, defalut: false }, height: { type: [String], default: "20%" }, title: { type: String, default: "" }, currentKey: { type: [Number, String], default: 0 }, currentTime: { type: Array, default: () => { return []; } }, lockScroll: { type: [Boolean], default: true }, teleportDisable: { type: Boolean, default: false } }, emits: ["update:visible", "select"], setup: (props, context) => { const classes = computed(() => { const prefixCls = componentName; return { [prefixCls]: true }; }); const popStyle = computed(() => { return { width: "100%", height: props.height }; }); const currentKey = computed(() => props.currentKey); const currentTime = computed(() => props.currentTime); const close = () => { context.emit("update:visible", false); context.emit("select", currentTime.value); }; provide("currentKey", currentKey); provide("currentTime", currentTime); return { classes, popStyle, props, close, translate }; } }); const _hoisted_1 = { class: "cqmc-time-select__title" }; const _hoisted_2 = { class: "cqmc-time-select__title__fixed" }; const _hoisted_3 = { key: 0 }; const _hoisted_4 = { class: "cqmc-time-select__content" }; const _hoisted_5 = { class: "cqmc-time-select__content__pannel" }; const _hoisted_6 = { class: "cqmc-time-select__content__detail" }; function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { const _component_nut_popup = resolveComponent("cqmc-popup"); return openBlock(), createBlock(_component_nut_popup, { position: "bottom", closeable: "", round: "", teleportDisable: _ctx.teleportDisable, visible: _ctx.visible, style: normalizeStyle(_ctx.popStyle), "lock-scroll": _ctx.lockScroll, onClickOverlay: _ctx.close, onClickCloseIcon: _ctx.close }, { default: withCtx(() => [ createElementVNode("view", { class: normalizeClass(_ctx.classes) }, [ createElementVNode("view", _hoisted_1, [ createElementVNode("view", _hoisted_2, [ !_ctx.$slots.title ? (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(_ctx.title || _ctx.translate("pickupTime")), 1)) : renderSlot(_ctx.$slots, "title", { key: 1 }) ]) ]), createElementVNode("view", _hoisted_4, [ createElementVNode("view", _hoisted_5, [ renderSlot(_ctx.$slots, "pannel") ]), createElementVNode("view", _hoisted_6, [ renderSlot(_ctx.$slots, "detail") ]) ]) ], 2) ]), _: 3 }, 8, ["teleportDisable", "visible", "style", "lock-scroll", "onClickOverlay", "onClickCloseIcon"]); } const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]); export { index as default };