Code Monkey home page Code Monkey logo

wepy-com-toast's Introduction

wepy-com-toast

一个 toast 消息框组件。

此组件依赖 wepy 1.7.0+。

如果你正在使用 wepy 2.x,请移步 wepy2-com-toast


用法

安装:

npm install @skit/wepy-com-toast --save

导入:

<template>
    <ui-toast />
</template>
<script>
    import wepy from 'wepy';
    import UIToast from '@skit/wepy-com-toast';

    export default class DemoPage extends wepy.page {
        components = {
            'ui-toast': UIToast
        };
    }
</script>

可配置项

属性:

方法:

/**
 * 显示消息对话框。
 * @param {Object} options 配置项。
 * @param {String} options.content 提示文本。
 * @param {String} options.position 对话框出现在屏幕的位置,支持“top”、“center”、“bottom”,默认值为“bottom”。
 * @param {String} options.duration 指定对话框若干毫秒后自动消失,默认值为“2000”。
 */
this.$invoke('ui-toast', 'show', {
    content: '这是一条消息',
    position: 'center',
    duration: 3000
});

/**
 * 显示消息对话框。
 * @param {String} content 消息文本。
 */
this.$invoke('ui-toast', 'show', '这是一条消息');

/**
 * 隐藏消息对话框。
 */
this.$invoke('ui-toast', 'hide');

wepy-com-toast's People

Contributors

fudiwei avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.