0.0.1-alpha-11 • Published 7 months ago

meixioacomponent-next-mobile v0.0.1-alpha-11

Weekly downloads
-
License
MIT
Repository
-
Last release
7 months ago

通用组件语法

附录

案例

ActionBtn:图标按钮组合组件

截图

action-btn

案例

<ActionBtn
  icon="edit"
  title="收藏"
  :size="10"
  :icon-size="14"
/>

参数

参数说明类型默认
direction可选项,排列方向'horizontal' | 'vertical'vertical
selected可选项,选中状态boolean-
color可选项,颜色string-
selectedColor可选项,选中颜色string-
icon必选项,图标string-
iconSize可选项,图标大小number14
title可选项,标题string-
size可选项,大小number14
gutter可选项,间隔距离number4

事件

事件说明类型
click点击事件() => void

CarItem:购物车单行组件

截图

car-item

car-item

案例

    <CarItem
      v-for="goods in records || []"
      :key="goods.goodsId"
      :check="carCheck(goods)"
      :thumb="goods.thumb"
      :title="goods.goodsName"
      :tag="goods.specifications"
      :price="goods.price"
      :amount="goods.amount"
      @check-change="checkChange($event, goods)"
      @amount-change="amountChange($event, goods)"
      @extra-click="extraClick"
    />

参数

参数说明类型默认
check可选项,选中状态booleanfalse
thumb必选项,商品缩略图string-
title必选项,商品标题string-
tag必选项,商品标签string-
price必选项,商品价格number-
amount必选项,商品数量number-

事件

事件说明类型
extraClick点击操作事件 (collection:收藏,delete:删除)(type: 'collection' | 'delete') => void
checkChange选中切换事件(state: boolean) => void
amountChange数量改变事件(state: number) => void

Container:容器组件

截图

container

案例

    <Container :gutter="[15, 10]">
      <GoodsCardHeader
        title="问大家"
        desc="(344)"
        arrow
        arrow-text="查看全部"
        @arrow-click="handleArrowClick"
      />
    </Container>

参数

参数说明类型默认
gutter可选项,间隔距离,(内边距)第一参数horizontal,第二参数verticalnumber | number[]0

Section:块组件

截图

section

案例

<Section :padding="[0, 0, 10, 0]">
  <GoodsCarousel :active="carouselActive" :items="carousels" />
</Section>
<Section :padding="[0, 10, 10, 10]">
  <GoodsInfoCard />
</Section>
<Section :padding="[0, 10, 10, 10]">
  <GoodsInfoGrid :items="data.cells" />
</Section>
<Section :padding="[0, 10, 10, 10]">
  <GoodsComment />
</Section>
<Section :padding="10">
  <GoodsAskFamily />
</Section>

参数

参数说明类型默认
padding可选项,内边距,可缩写,与css效果一致number | number[]-
margin可选项,外边距,可缩写,与css效果一致number | number[]-

CouponTag:优惠劵标签组件

截图

coupon-tag

案例

<CouponTag :price="8" size="mini" />
<CouponTag prefix="惠" :price="8" size="mini" />

参数

参数说明类型默认
prefix可选项,前缀string
price必选项,价格number-
size可选项,尺寸'mini' | 'small'small

Divider:分割线组件

截图

divider

案例

<Divider title="商品详情" />

参数

参数说明类型默认
title必选项,标题string-

SafeArea:安全区组件

截图

divider

案例

<SafeArea position="both">
  ...
</SafeArea>

// 或者
<SafeArea position="bottom" />

参数

参数说明类型默认
position可选项,安全区位置'both' | 'top' | 'bottom'both

GoodsCard:商品卡片组件

截图

image-20230114134538553

案例

<GoodsCard 
   v-for="item in goodsList"
   :thumb="item.url"
>
  <template #top>top</template>
  <template #center>content</template>
  <template #bottom>bottom</template>
</GoodsCard>

参数

参数说明类型默认
thumb必选项,图片路径string-
size可选项,图片大小。对应图片width, heightnumber[]88, 88

插槽

slots说明
top对应截图案例中商品名称
center对应截图案例中商品数量
bottom对应截图案例中商品规格

InfoCell:详细内容展示组件

截图

image-20230114142525201

案例

<InfoCell :list="list" :data="refundData" :bottom="'12px'" />

const list: listItem[] = [
  { label: '退款原因:', key: 'remark' },
  { label: '退款金额:', key: 'totalPrice', type: 'price' },
  { label: '申请时间:', key: 'time' },
  { label: '退款编号:', key: 'refundSn' },
];

const refundData = {
  remark: '多拍/拍错/不想要',
  totalPrice: '499.00',
  time: '2022-04-03  11:57:56',
  refundSn: '1654654646',
}

listItem

参数说明类型默认
key必填项,后端对应的字段string-
label必填项,需要渲染的标题string-
template选填项,是否开启插槽booleanfalse
type选填项,需要特殊展示字段, 可以自行扩展itemType-

参数

参数说明类型默认
list必填项,需要渲染的内容listItem[]-
data必填项,后端返回的数据Record<string, any>-
labelColor选填项,label颜色string#9A9A9A
labelWidth选填项,label宽度string70px
color选填项,颜色string#9A9A9A
bottom选填项,下边距string10px
size选填项,字体大小string14px
layout选填项,对齐方式start | endstart

插槽

slots说明
key对应listItem中的key