1.0.2 • Published 2 months ago

@shawyu/modal v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

@shawyu/modal

modal.js 是一款轻量级用来显示模态对话框的插件。

Github地址

https://github.com/shawyuu/js-plugin/tree/main/modal

Getting started

Install

npm install @shawyu/modal

In browser

<script src="../modal/index.js"></script>

Usage

import Modal from '@shawyu/modal'

Modal.show({
	title: '提示',
	content: '这是一个模态弹窗',
	confirm:()=> {
		console.log('用户点击确定')
	},
	cancel:()=> {
		console.log('用户点击取消')
	}
})

All Props

属性类型默认值必需描述
titlestring | NO | 提示的标题
contentstring | YES |提示的内容,可以是普通字符串,也可以是HTML字符串
showCancelbooleantrueNO是否显示取消按钮
cancelTextstring取消NO取消按钮的文字
cancelColorstring#f5f6f7NO取消按钮的背景颜色,显示颜色的字符串
showConfirmbooleantrueNO是否显示确认按钮
confirmTextstring确定NO确认按钮的文字
confirmColorstring#3565eeNO确认按钮的背景颜色,显示颜色的字符串
maskColorstringrgba(0,0,0,0.5)NO遮罩的背景颜色,显示颜色的字符串
maskClosablebooleantrueNO是否可以点击遮罩关闭提示
cancelfunctionnullNO点击取消的回调函数
confirmfunctionnullNO点击确认的回调函数

Logs

1.0.0 version\

1.0.2

2 months ago

1.0.1

2 months ago

1.0.0

2 months ago