fastman3-component-pay
v1.0.1
Published
支付组件
Downloads
2
Readme
fastman3-component-pay
协议组件封装
CHANGELOG
v 1.0.0 - 2022.03.30
- 初始化构建
安装
使用 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>
);
};