ProductPendant - 商品挂件组件
更新时间:2025-09-05 09:41:51
简介
商品挂件是一个入口组件,点击后可以查看商品列表。
引入方式
UMD 引入
其中 rc-20250814 为当前版本号,请根据实际版本号进行引入。
<script src="https://websdk.videocc.net/product-ui/rc-20250814/mobile-product-pendant.umd.js"></script>
<script src="https://websdk.videocc.net/product-ui/rc-20250814/pc-product-pendant.umd.js"></script>
<script>
const MobileProductPendant = window.PolyvProductUIMobileProductPendant;
const PcProductPendant = window.PolyvProductUIPcProductPendant;
</script>
NPM 引入
pnpm add @polyv/product-ui
import { MobileProductPendant, PcProductPendant } from '@polyv/product-ui';
使用示例
移动端挂件
<template>
<MobileProductPendant
:product-target="productTarget"
@click-pendant="handleClickPendant"
/>
</template>
<script setup>
import { MobileProductPendant } from '@polyv/product-ui';
const productTarget = new Product(interactionCore, { getProductConfig });
function handleClickPendant() {
console.log('点击商品挂件');
// 打开商品列表弹窗
}
</script>
PC端挂件
<template>
<PcProductPendant
:product-target="productTarget"
@click-pendant="handleClickPendant"
/>
</template>
<script setup>
import { PcProductPendant } from '@polyv/product-ui/product-pendant';
const productTarget = new Product(interactionCore, { getProductConfig });
function handleClickPendant() {
console.log('点击商品挂件');
// 打开商品列表弹窗
}
</script>
API
MobileProductPendant Props
MobileProductPendant Events
PcProductPendant Props
PcProductPendant Events