1.1.2 • Published 5 years ago

iu-toast v1.1.2

Weekly downloads
3
License
ISC
Repository
github
Last release
5 years ago

中文 | ENGLISH

iu-toast

The native js toast plug-in does not depend on any libraries.

Installation & Use

  • Introduction Method 1:
<link rel="stylesheet" href="iu-toast.min.css">
<script src="iu-toast.min.js"></script>
  • Introduction Method 2:
npm install iu-toast
import 'iu-toast/dist/iu-toast.min.css'
import iToast from 'iu-toast';
  • Use
iToast('提示内容')
// 成功提示
iToast.success()
// 失败提示
iToast.fail()
// 加载提示
iToast.loading()

API

MethodDescriptionParameterReturn value
iToastDisplay tipsoptions or messagetoast instance
iToast.loadingShow loading tipsoptions or messagetoast instance
iToast.successPrompt for successful displayoptions or messagetoast instance
iToast.failDisplay failure promptoptions or messagetoast instance
iToast.clearClear prompt-void
iToast.allowMultiToastAllow multiple Toast at the same time-void
iToast.setConfigModify the default configuration for all Toast. You can specify the default configuration for a specified item by specifying the type.options or typevoid
iToast.resetConfigReset the default configuration, which takes effect for all Toast. You can reset the default configuration of a specified item by specifying the type.typevoid

Options

ParameterDescriptionTypeDefault value
TypeThe type of the prompt. Valid values: loading success fail textstringtext
PositionThe location of the display. Valid values: top bottomstringmiddle
MessageText contentstring''
overlayDo you want to disable background clicks?booleanfalse
overlayWhether the mask layer is displayedbooleanfalse
DurationThe display duration (ms). When the value is 0, toast does not disappear.Number2000
onOpenedCallback function after full displayFunction-
onCloseCallback function when closedFunction-

PS: when using loading api , success api , fail api When type The configuration item is invalid, success api , fail api Force overlay For true

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.2

5 years ago

1.0.3

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago