UNPKG

@gyenno/nutui-taro

Version:

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

130 lines (129 loc) 4.17 kB
import { c as createComponent } from "./component-25dcca32.js"; import { resolveComponent, openBlock, createElementBlock, createElementVNode, createTextVNode, toDisplayString, renderSlot, createBlock, createCommentVNode, Fragment, createVNode, withCtx } from "vue"; import Price from "./Price.js"; import Tag from "./Tag.js"; import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js"; import "../locale/lang"; import "@nutui/icons-vue-taro"; const { create } = createComponent("card"); const _sfc_main = create({ components: { [Price.name]: Price, [Tag.name]: Tag }, props: { imgUrl: { type: String, default: "" }, title: { type: String, default: "" }, price: { type: String, default: "" }, vipPrice: { type: String, default: "" }, shopDesc: { type: String, default: "" }, delivery: { type: String, default: "" }, shopName: { type: String, default: "" }, isNeedPrice: { type: Boolean, default: true } }, setup(props, { emit, slots }) { const isHaveSlot = (slot) => { return slots[slot]; }; return { isHaveSlot }; } }); const _hoisted_1 = { class: "nut-card" }; const _hoisted_2 = { class: "nut-card__left" }; const _hoisted_3 = ["src"]; const _hoisted_4 = { class: "nut-card__right" }; const _hoisted_5 = { class: "nut-card__right__title" }; const _hoisted_6 = { key: 0, class: "nut-card__right__price" }; const _hoisted_7 = { class: "nut-card__right__other" }; const _hoisted_8 = { class: "nut-card__right__shop" }; const _hoisted_9 = { class: "nut-card__right__shop__name" }; function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { const _component_nut_price = resolveComponent("nut-price"); const _component_nut_tag = resolveComponent("nut-tag"); return openBlock(), createElementBlock("div", _hoisted_1, [ createElementVNode("div", _hoisted_2, [ createElementVNode("img", { src: _ctx.imgUrl, alt: "" }, null, 8, _hoisted_3) ]), createTextVNode(), createElementVNode("div", _hoisted_4, [ createElementVNode("div", _hoisted_5, toDisplayString(_ctx.title), 1), createTextVNode(), renderSlot(_ctx.$slots, "prolist"), createTextVNode(), _ctx.isNeedPrice ? (openBlock(), createElementBlock("div", _hoisted_6, [ _ctx.isHaveSlot("price") ? renderSlot(_ctx.$slots, "price", { key: 0 }) : (openBlock(), createBlock(_component_nut_price, { key: 1, price: _ctx.price }, null, 8, ["price"])), createTextVNode(), _ctx.isHaveSlot("origin") ? renderSlot(_ctx.$slots, "origin", { key: 2 }) : (openBlock(), createBlock(_component_nut_price, { key: 3, class: "nut-card__right__price__origin", price: _ctx.vipPrice }, null, 8, ["price"])), createTextVNode(), _ctx.isHaveSlot("tag") ? renderSlot(_ctx.$slots, "tag", { key: 4 }) : createCommentVNode("", true) ])) : createCommentVNode("", true), createTextVNode(), createElementVNode("div", _hoisted_7, [ _ctx.isHaveSlot("shop-tag") ? renderSlot(_ctx.$slots, "shop-tag", { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [ createVNode(_component_nut_tag, { type: "danger" }, { default: withCtx(() => [ createTextVNode(toDisplayString(_ctx.shopDesc), 1) ]), _: 1 }), createTextVNode(), createVNode(_component_nut_tag, { plain: "" }, { default: withCtx(() => [ createTextVNode(toDisplayString(_ctx.delivery), 1) ]), _: 1 }) ], 64)) ]), createTextVNode(), createElementVNode("div", _hoisted_8, [ createElementVNode("div", _hoisted_9, toDisplayString(_ctx.shopName), 1), createTextVNode(), renderSlot(_ctx.$slots, "footer") ]) ]) ]); } const index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]); export { index_taro as default };