@skit/wepy-com-toast

1.0.0 • Public • Published

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');

Readme

Keywords

none

Package Sidebar

Install

npm i @skit/wepy-com-toast

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

7.2 kB

Total Files

4

Last publish

Collaborators

  • fudiwei