1.0.1 • Published 3 years ago

universal-action-sheet v1.0.1

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

showActionSheet

npm npm

Displays the operation menu.

Supported

Install

$ npm install universal-showActionSheet --save

or

$ npm install universal-api --save

Usage

import showActionSheet from 'universal-showActionSheet';

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 { showActionSheet } from 'universal-api';

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

Return

PropertyTypeDescription
tapIndexnumberThe sequence number of the button tapped by the user, from top to bottom and starting from 0
/**
 * iframe: true
 */
import React from 'react';
export default () => (
  <iframe style={{
      boxShadow: '0 2px 15px rgba(0,0,0,0.1)',
      width: '375px',
      height: '700px'
    }} src='https://herbox.online/p/109000004/app_1aKtEd7SK?previewZoom=100&view=preview&defaultPage=pages/universal-action-sheet/index&topSlider=false'></iframe>
);
2.0.0-beta

3 years ago

1.0.1

4 years ago

1.0.0-beta.1

4 years ago