Socket
Socket
Sign inDemoInstall

@ubrorg/confirm

Package Overview
Dependencies
Maintainers
11
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ubrorg/confirm

confirm


Version published
Maintainers
11
Created
Source

confirm

confirm

使用

在页面的 page.json 中配置:

{
  "usingComponents": {
    "confirm": "@ubrorg/confirm/lib/index"
  }
}

在页面的 page.axml 中直接使用:

<confirm />

给页面中的按钮添加事件如:

<!-- html -->
<button onTap="buttonConfirm">点击按钮</button>

<!-- js -->
import { confirm } from '@ubrorg/toast/lib/confirm';

 buttonConfirm() {
    confirm({
      content: '您本月的账单已出',
      buttonText: '我知道了',
      input:true,
      title:'这里是title'
      confirm: (v) => { console.log('点击了确认按钮', v) },
      cancel: () => { console.log('点击了取消按钮') },
      complete: () => { console.log('调用成功') },
    });
  }

配置

属性是否必传默认值解释类型
contentN' '弹窗的文本,content为提示文字string
confirmButtonTextN'确认'确认按钮上的提示文字string
cancelButtonTextN'取消'取消按钮上的提示文字string
completeN调用结束的回调函数function
confirmNvalue点击确认按钮后的回调函数,参数 value 为输入框的内容function
cancelN点击取消按钮后的回调函数function
inputNfalseinput 为 true 时,代表这是个可以输入的 confirm 弹窗boolean
titleN''title 是可以输入弹窗的标题string

开发

  1. yarn 或者 ayarn阿里内网)安装依赖
  2. 小程序 IDE 打开组件(下载地址

更多命令

  • miapp newbranch: 新建分支
  • miapp push: 提交代码
  • miapp prepub: 预发(发布 beta 版本)
  • miapp publish: 正式发布

FAQs

Package last updated on 04 Feb 2021

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc