Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

weex-plugin-weex-actionsheet

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

weex-plugin-weex-actionsheet - npm Package Compare versions

Comparing version 1.0.9 to 1.1.0

19

doc/zh/README.md

@@ -1,20 +0,1 @@

#### ActionSheet
* 名字
- actionSheet
* 类型
- module
* 平台
- 三端
* api
1. 调用actionSheet
- create(dictionary options) 调用actionSheet
- options:actionSheet数据源(dictionary)<br />
items:actionSheet数据源(array)
- callback(options) 选择完成按钮确认回调
- options:返回的选择结果(dictionary)<br />
result:结果三种类型 success,cancel,error (string)<br />
data:选择的值(string)<br />
message:选择信息'ok','error info'(sting)
# ActionSheet

@@ -21,0 +2,0 @@

2

package.json
{
"version": "1.0.9",
"version": "1.1.0",
"platform": [

@@ -4,0 +4,0 @@ "ios"

@@ -1,18 +0,103 @@

#### ActionSheet
* 名字
- actionSheet
* 类型
- module
* 平台
- 三端
* api
1. 调用actionSheet
- create(dictionary options) 调用actionSheet
- options:actionSheet数据源(dictionary)<br />
items:actionSheet数据源(array)
- callback(options) 选择完成按钮确认回调
- options:返回的选择结果(dictionary)<br />
result:结果三种类型 success,cancel,error (string)<br />
data:选择的值(string)<br />
message:选择信息'ok','error info'(sting)
# ActionSheet
## 概述
是actionsheet ,方便用户事件选择 以下为 actionSheet 相关的 API
## API
### `create(options, callback[options])`
调用单选 picker
#### 参数
- `options {Object}`:调用单选 ActionSheet 选项
- `index {number}`:默认选中的选项
- `title {string}`:ActionSheet 名称
- `message {string}`:ActionSheet 提示内容
- `items {array}`:ActionSheet 数据源
- `message {string}`:
- `type {number}`:button类型,cancel(type==1)只能有一个
- `callback {function (ret)}`:执行完读取操作后的回调函数。`ret {Object}` 为 `callback` 函数的参数,有两个属性:
- `result {string}`:结果三种类型 `success`, `cancel`, `error`
- `data {Object}`:选择的结果。
- `index {number}`:选中的项
- `message`:选中的内容
#### 示例
```html
<template>
<scroller>
<wxc-panel title="action module" type="primary">
<text style="margin-bottom: 20px;">action value: {{value}}</text>
<wxc-button type="primary" onclick="{{createAction}}" value="create action" style="margin-bottom: 20px;"></wxc-button>
</wxc-panel>
</scroller>
</template>
<style>
.input {
font-size: 60px;
height: 80px;
width: 400px;
}
</style>
<script>
require('weex-components');
module.exports = {
data: {
value: '',
index: 0,
txtChange: ''
},
methods: {
createAction: function() {
var actionSheet = require('@weex-module/actionSheet');
var items = [];
for ( var i=0; i< 3; i++) {
var item = {};
if(i == 0)
{
item = {'type':0,'message':'确认'};
}
if(i == 1)
{
item = {'type':1,'message':'取消'};
}
if(i == 2)
{
item = {'type':2,'message':'删除'};
}
items.push(item);
}
var self = this;
actionSheet.create({
'items':items,
'index':self.index,
'title':'提示',
'message':'欢迎使用weex第三方市场'
},function (ret) {
var result = ret.result;
if(result == 'success')
{
self.value = ret.data.message;
self.index = ret.data.index;
}
});
},
onchange: function(event) {
this.txtChange = event.value;
console.log('onchange', event.value);
}
}
}
</script>
```
[Have a try](http://dotwe.org/c3856e6035fce2f8511a021a5360d3da)

@@ -1,18 +0,103 @@

#### ActionSheet
* 名字
- actionSheet
* 类型
- module
* 平台
- 三端
* api
1. 调用actionSheet
- create(dictionary options) 调用actionSheet
- options:actionSheet数据源(dictionary)<br />
items:actionSheet数据源(array)
- callback(options) 选择完成按钮确认回调
- options:返回的选择结果(dictionary)<br />
result:结果三种类型 success,cancel,error (string)<br />
data:选择的值(string)<br />
message:选择信息'ok','error info'(sting)
# ActionSheet
## 概述
是actionsheet ,方便用户事件选择 以下为 actionSheet 相关的 API
## API
### `create(options, callback[options])`
调用单选 picker
#### 参数
- `options {Object}`:调用单选 ActionSheet 选项
- `index {number}`:默认选中的选项
- `title {string}`:ActionSheet 名称
- `message {string}`:ActionSheet 提示内容
- `items {array}`:ActionSheet 数据源
- `message {string}`:
- `type {number}`:button类型,cancel(type==1)只能有一个
- `callback {function (ret)}`:执行完读取操作后的回调函数。`ret {Object}` 为 `callback` 函数的参数,有两个属性:
- `result {string}`:结果三种类型 `success`, `cancel`, `error`
- `data {Object}`:选择的结果。
- `index {number}`:选中的项
- `message`:选中的内容
#### 示例
```html
<template>
<scroller>
<wxc-panel title="action module" type="primary">
<text style="margin-bottom: 20px;">action value: {{value}}</text>
<wxc-button type="primary" onclick="{{createAction}}" value="create action" style="margin-bottom: 20px;"></wxc-button>
</wxc-panel>
</scroller>
</template>
<style>
.input {
font-size: 60px;
height: 80px;
width: 400px;
}
</style>
<script>
require('weex-components');
module.exports = {
data: {
value: '',
index: 0,
txtChange: ''
},
methods: {
createAction: function() {
var actionSheet = require('@weex-module/actionSheet');
var items = [];
for ( var i=0; i< 3; i++) {
var item = {};
if(i == 0)
{
item = {'type':0,'message':'确认'};
}
if(i == 1)
{
item = {'type':1,'message':'取消'};
}
if(i == 2)
{
item = {'type':2,'message':'删除'};
}
items.push(item);
}
var self = this;
actionSheet.create({
'items':items,
'index':self.index,
'title':'提示',
'message':'欢迎使用weex第三方市场'
},function (ret) {
var result = ret.result;
if(result == 'success')
{
self.value = ret.data.message;
self.index = ret.data.index;
}
});
},
onchange: function(event) {
this.txtChange = event.value;
console.log('onchange', event.value);
}
}
}
</script>
```
[Have a try](http://dotwe.org/c3856e6035fce2f8511a021a5360d3da)

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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