1.0.8 • Published 2 years ago

@uni/action-sheet v1.0.8

Weekly downloads
3
License
BSD-3-Clause
Repository
github
Last release
2 years ago

actionSheet

npm

Displays the operation menu.

Supported

Install

$ npm install @uni/action-sheet --save

or

$ npm install @uni/apis --save

Usage

import showActionSheet from '@uni/action-sheet';

showActionSheet({
  itemList: ['A', 'B', 'C'],
  success (res) {
    console.log(res.tapIndex)
  },
  fail (res) {
    console.log(res.errMsg)
  }
});

// promise
showActionSheet({
  itemList: ['A', 'B', 'C']
}).then(res => {
    console.log(res.tapIndex)
});

You can also import from the big package:

import { actionSheet } from '@uni/apis';
actionSheet({
  itemList: ['A', 'B', 'C']
}).then(res => {
  console.log(res.tapIndex)
});

Methods

showActionSheet(options)

Arguments

PropertyTypeDescriptionrequiredDefault
optionsobject✔️-
options.itemListArray<string> The text array of the button, with a length limited to 6✔️-
options.successFunction The callback function for a successful API call-
options.failFunction The callback function for a failed API call-
options.completeFunction The callback function used when the API call completed (always executed whether the call succeeds or fails)-

Special Arguments

PropertyTypeDescriptionrequiredDefaultSupported
options.titlestringThe title of actionsheet
options.alertTextstring The alert text 2.14.0
options.itemColorstring The text color of the button#000000
options.cancelButtonTextstring The text of cancel buttoncancel
options.destructiveBtnIndexnumber get more on ali document no Dingding
options.badgesArray<Object> get more on ali document no Dingding

Return

PropertyTypeDescription
tapIndexnumberThe sequence number of the button tapped by the user, from top to bottom and starting from 0, The value is -1 when the mask or cancel button is clicked by the user
1.0.8

2 years ago

1.0.7-beta

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.4-beta

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

1.0.0-beta1

4 years ago

1.0.0-beta

4 years ago