Polyv Help Center

Help Center

ProductPendant - Product Pendant Component

Updated: 2025-09-05 09:41:51

Introduction

The product pendant is an entry component. Clicking it allows you to view the product list.

Import Methods

UMD Import

Here, rc-20250814 is the current version number. Please import based on the actual version number.

<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 Import

pnpm add @polyv/product-ui

import { MobileProductPendant, PcProductPendant } from '@polyv/product-ui';

Usage Examples

Mobile Pendant

<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 Pendant

<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

Parameter Description Type Default
productTarget Product module instance Product -

MobileProductPendant Events

Event Name Description Callback Parameters
click-pendant Click on the pendant -

PcProductPendant Props

Parameter Description Type Default
productTarget Product module instance Product -

PcProductPendant Events

Event Name Description Callback Parameters
click-pendant Click on the pendant -
联系客服,在线咨询