You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

tingle-dialog

Package Overview
Dependencies
Maintainers
4
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tingle-dialog

对话框,提供定位和遮罩。

0.2.1
latest
Source
npm
Version published
Weekly downloads
10
233.33%
Maintainers
4
Weekly downloads
 
Created
Source

tingle-dialog npm version

对话框

Simple Usage

Dialog.alert({
	title: '测试',
	children: '我是测试我是测试我是测试我是测试我是测试',
	onConfirm() {
    	console.log('alert confirm');
	}
});

Dialog.confirm({
	title: '测试',
	children: '我是测试内容我是测试内容我是测试内容我是测试内容我是测试内容我是测试内容我是',
	onConfirm() {
	    console.log('confirm confirm');
	},
	onCancel() {
	    console.log('confirm cancel');
	}
});

可用配置

配置项类型必填默认值功能/备注
showbooleanrequiredfalse是否显示对话框
titlestringrequired-对话框的标题
childrenstringoptional-对话框的内容
maskbooleanoptionaltrue是否显示遮罩层
buttonsarrayoptional一个确定按钮一个数组,可以配置多个对话框上的按钮,具体的配置参考按钮的配置

按钮的配置

配置项类型必填默认值功能/备注
childrenstringrequired-按钮的内容
callbackfunctionoptional-点击按钮的回调, 返回false就不会自动关闭对话框
primarybooleanoptionalfalse是否作为主按钮

API接口

Dialog.alert(options)

静态方法,显示全局的 Dialog,可用参数请参考可用配置,其中回调函数是onConfirm。

Dialog.confirm()

静态方法,显示全局的 Dialog,可用参数请参考可用配置,其中回调函数是onConfirm和onCancel。

Dialog.hide()

静态方法,关闭全局的Dialog

###show 实例方法,显示一个对话框

###hide

实例方法,关闭一个对话框

Keywords

tingle-dialog

FAQs

Package last updated on 01 Jun 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts