@dfeidao/fd-m000008
TypeScript icon, indicating that this package has built-in type declarations

4.6.201906031620 • Public • Published

NumPwdBox密码输入框

https://dfeidao.gitee.io/widgets-mobile/

Installation

yarn add --dev @dfeidao/fd-m000008

属性

属性 默认值 类型 描述
length number 密码长度
title string 支付窗口标题
tip string 提示文字
show boolean 设置支付窗口显示
onCancel function 用户取消事件
onComplete function 用户输入完成

使用示例

tpl.tsx

export default function tpl(...) {
	const show = d('show') as unknown as boolean;
	const tip = d('tip') as string;
	return (
		<View>
			<Text onPress={a('a001')}>
				点击支付
			</Text>
			<NumPwdBox
				length={6}
				title={'请输入密码!'}
				onCancel={a('a002')}
				onComplete={a('a003')}
				show={show}
				tip={tip}
			>
			</NumPwdBox>
		</View>
	);
}

a001.ts

export default async function a001(fd: IFeidaoAiMobile) {
	render(fd, {
		show: true,
		tip: ''
	});
}

a002.ts

export default async function a002(fd: IFeidaoAiMobile) {
	render(fd, {
		show: false
	});
}

a003.ts

export default async function a003(fd: IFeidaoAiMobile, e: string) {
	console.log('用户输入的密码: ', e);
	if (/** 密码错误 **/) {
		render(fd, {
			tip: '密码输入错误,请重新输入'
		});
	} else {
		render(fd, {
			show: false
		});
	}
}

Package Sidebar

Install

npm i @dfeidao/fd-m000008

Weekly Downloads

1

Version

4.6.201906031620

License

MIT

Unpacked Size

15 kB

Total Files

7

Last publish

Collaborators

  • taoqf