wpy-wx-confirmaction

1.0.2 • Public • Published

微信小程序 wepyjs 第三方confirmAction组件

confirmaction

说明

官方的actionsheet不能满足要求。所有开发了一个带提示和确定取消组件。 此组件依赖于wepyjs v1.5.2+

使用

有隐藏,有事件触发,比较复杂。请看示例吧

安装组件

npm install wpy-wx-confirmaction --save-dev

引入组件

// index.wpy
<template>
    <CofirmAction :cofirmhidden.sync="cofirmhidden" :actionTitle.sync="actionTitle" />
</template>
<script>
    import wepy from 'wepy';
    import confirmAction from 'wpy-wx-confirmaction';

    export default class Index extends wepy.page {
        components = {
            CofirmAction: confirmAction
        }

    }
</script>

调用方法(初始化默认值)

    this.cofirmhidden = true
    this.actionTitle = '确定要删除吗'
    CofirmAction.initAction({
        confirm() {
            console.log('confirm...')
            that.cofirmhidden = false
            wx.showToast({
            title: "删除成功",
            duration: 3000
            })
        },
        cancel() {
            console.log('cancel...')
            that.cofirmhidden = false
            wx.showToast({
            title: "取消删除",
            duration: 3000
            })
        }
    })

更多说明

参考github源码地址

Package Sidebar

Install

npm i wpy-wx-confirmaction

Weekly Downloads

0

Version

1.0.2

License

ISC

Last publish

Collaborators

  • doingqilai