UNPKG

nutui-taro-upgrade

Version:

@nutui/nutui-taro 对京东风格组件库的taro4 版本支持

68 lines (67 loc) 2.33 kB
var __defProp = Object.defineProperty; var __defProps = Object.defineProperties; var __getOwnPropDescs = Object.getOwnPropertyDescriptors; var __getOwnPropSymbols = Object.getOwnPropertySymbols; var __hasOwnProp = Object.prototype.hasOwnProperty; var __propIsEnum = Object.prototype.propertyIsEnumerable; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __spreadValues = (a, b) => { for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]); if (__getOwnPropSymbols) for (var prop of __getOwnPropSymbols(b)) { if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]); } return a; }; var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); import { inject, reactive, computed, toRefs, openBlock, createElementBlock, normalizeClass, toDisplayString } from "vue"; import { c as createComponent } from "../component-669c158a.js"; import { _ as _export_sfc } from "../_plugin-vue_export-helper-cc2b3d55.js"; const { componentName, create } = createComponent("time-pannel"); const _sfc_main = create({ name: "timepannel", props: { name: { type: String, default: "" }, pannelKey: { type: [Number, String], default: 0 } }, emits: ["change"], setup: (props, { emit }) => { const currentKey = inject("currentKey"); const state = reactive({ currentKey }); const classes = computed(() => { const prefixCls = componentName; return { [prefixCls]: true, "nut-time-pannel--curr": state.currentKey == props.pannelKey }; }); const handlePannel = (pannelKey) => { emit("change", pannelKey); }; return __spreadProps(__spreadValues({}, toRefs(state)), { classes, handlePannel }); } }); function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { return openBlock(), createElementBlock("view", { class: normalizeClass(_ctx.classes), onClick: _cache[0] || (_cache[0] = ($event) => _ctx.handlePannel(_ctx.pannelKey)) }, toDisplayString(_ctx.name), 3); } const index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]); export { index_taro as default };