@skit/wepy2-com-loading
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

wepy2-com-loading

一个阻塞页面的加载动画组件。

此组件依赖 wepy 2.0.0+。

如果你正在使用 wepy 1.x,请移步 wepy-com-loading


用法

安装:

npm install @skit/wepy2-com-loading --save

导入:

<template>
    <ui-loading ref="loading" />
</template>
<config>
{
    usingComponents: {
        'ui-loading': 'module:@skit/wepy2-com-loading'
    }
}
</config>
<script>
    import Wepy from 'wepy';

    Wepy.page({
        onShow() {
            this.$refs['loading'].show('loading ...');
        }
    });
</script>

注意:当前版本的 wepy-cli 存在 Bug,无法打包通过 node_modules 引入的 wpy 组件,解决方案请参考 Issue#2554

可配置项

属性:

方法:

/**
 * 显示加载对话框。
 * @param {Object} options 配置项。
 * @param {String} options.content 提示文本。
 */
this.$refs['loading'].show({
    content: '加载中'
});

/**
 * 显示加载对话框。
 * @param {String} content 提示文本。
 */
this.$refs['loading'].show('加载中');

/**
 * 隐藏加载对话框。
 */
this.$refs['loading'].hide();

Readme

Keywords

none

Package Sidebar

Install

npm i @skit/wepy2-com-loading

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

9.38 kB

Total Files

5

Last publish

Collaborators

  • fudiwei