New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

nuke-biz-custom-toast

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nuke-biz-custom-toast

nuke-biz-custom-toast

latest
npmnpm
Version
0.0.2
Version published
Maintainers
1
Created
Source

CustomToast

  • category: UI
  • chinese: 图标
  • type: UI组件

何时使用

需要定制 toast 的文案、Icon 时

API

参数说明类型默认值
type浮层类型,枚举可选'success','error','warning'string'success'
message文案string
onHide关闭时触发回调function
onShow打开后后触发回调functionfalse
maxLines文字最大行数,默认3,建议不要改number3
durationtoast 出现多久后消失,默认2snumber2000

demo


/** @jsx createElement */
import {createElement, Component,render } from 'rax';
import {View,Text,Page,Button} from 'weex-nuke';
import CustomToast from 'nuke-biz-custom-toast';

let App = class NukeDemoIndex extends Component {
  constructor() {
    super();
    this.closeHandler = this.closeHandler.bind(this);
    this.showToast = this.showToast .bind(this);
  }
  showToast(){
    this.toast.wrappedInstance.show();
  }
  closeHandler(){
    console.log('toast closed');
  }
  render() {
    return (
      <Page title="custom-toast">
          <Page.Intro main="basic" sub="basic-sub"/>
          <Button onPress={this.showToast} type="primary">点我</Button>
          <CustomToast
            defaultVisible={false}
            ref={(n)=>{this.toast = n;}}
            message={'Thank you for your feedback!'}
            icon={{
              source:
                '//img.alicdn.com/tfs/TB1k.IIPVXXXXcWapXXXXXXXXXX-200-200.png',
              style: {
                width: '40rem',
                height: '40rem',
              },
            }}
            onHide={this.closeHandler}
          />
      </Page>
    );
  }
}

render(<App/>);

Keywords

nuke

FAQs

Package last updated on 05 Mar 2018

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