Socket
Socket
Sign inDemoInstall

tingle-dialog

Package Overview
Dependencies
5
Maintainers
4
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    tingle-dialog

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


Version published
Maintainers
4
Install size
287 kB
Created

Readme

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

FAQs

Last updated on 01 Jun 2016

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc