|
|
преди 3 години | |
|---|---|---|
| .. | ||
| src | преди 3 години | |
| README.md | преди 3 години | |
| cooking.conf.js | преди 3 години | |
| index.js | преди 3 години | |
| package.json | преди 3 години | |
mint-actionsheet is an action sheet component for vue.js
First, install mint-actionsheet from npm:
$ npm install mint-actionsheet
Import it:
require ('mint-actionsheet/lib/index.css');
// ES6 mudule
import Actionsheet from 'mint-actionsheet';
// CommonJS
const Actionsheet = require('mint-actionsheet').default;
Register component:
Vue.component('actionsheet', Actionsheet);
Then use it:
<actionsheet :actions="actions" :visible.sync="sheetVisible"></actionsheet>
actions is an array of objects. Each object has two keys: name and method. name is the text showing on the sheet, and method (optional) is the callback when clicked.
Sync visible with one of your vue instance variables. Toggle it to switch on/off the action sheet.
| Option | Description | Value | Default |
|---|---|---|---|
| actions | array of actions | Array | |
| visible | visibility of the action sheet | Boolean | 'false' |
| cancelText | text of the cancel button | String | '取消' |
| closeOnClickModal | determines if the action sheet turn off when the modal is clicked | Boolean | 'true' |
MIT