0.0.2 • Published 8 years ago

now-base-apptoast v0.0.2

Weekly downloads
1
License
MIT
Repository
-
Last release
8 years ago

now-base-apptoast app阻断式通知栏

Toast 默认 Fixed 定位, 出现在页面顶部, 文字默认距离顶部 20px

Props

属性说明类型默认值是否必传
typeToast 样式 , 'success', 'error', 'info', 'warn'string'info'
top文字距离顶部位置number20

Method

  • create(opts)

opts 与 Props 构造一样, 调用 create 后会直接创建一个 Toast。

会返回一个引用,可以通过该引用关闭Toast。

const appToast = AppToast.create({
  type: 'error'
  content: '错误'
});

appToast.remove()

传参示例

import AppToast from 'now-base-apptoast'
<AppToast type={1} disabled={true} style={buttonStyle} top={0}>
  显示的文字
</AppToast>