fastman3-component-pay
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

fastman3-component-pay

协议组件封装

CHANGELOG

v 1.0.0 - 2022.03.30

  1. 初始化构建

安装

使用 npm:

$ npm install fastman3-component-pay --save

使用 cnpm:

$ cnpm install fastman3-component-pay --save

使用 yarn:

$ yarn add fastman3-component-pay

示例

import React, { FC, useRef } from "react";
import { View, Button } from "@tarojs/components";
import { IPayPanelRefType, PayPanel } from "fastman3-component-pay";

interface PayDemoProps extends CommonProps {
  // 父组件要传的 prop 放这
}

const PayDemo: FC<PayDemoProps> = (props) => {

  const _ref = useRef<IPayPanelRefType>();

  async function updateIsOpen() {
    try {
      const pwd = await _ref?.current?.open?.();
      console.log("pwd", pwd);
    } catch (error) {
      console.log("error", error);
    }
  }
  return (
    <View className='payDemo-page'>
      <Button onClick={updateIsOpen}>点击打开/关闭面板 Btn</Button>
      <PayPanel ref={_ref} />
    </View>
  );
};

Readme

Keywords

Package Sidebar

Install

npm i fastman3-component-pay

Weekly Downloads

2

Version

1.0.1

License

ISC

Unpacked Size

45.4 kB

Total Files

21

Last publish

Collaborators

  • crixusshen