提交 5a069e50 编写于 作者: fxy060608's avatar fxy060608

build uni runtime (includes=>indexOf)

上级 6f5accca
...@@ -173,7 +173,7 @@ function processArgs (methodName, fromArgs, argsOption = {}, returnValue = {}, k ...@@ -173,7 +173,7 @@ function processArgs (methodName, fromArgs, argsOption = {}, returnValue = {}, k
} else if (isPlainObject(keyOption)) { // {name:newName,value:value}可重新指定参数 key:value } else if (isPlainObject(keyOption)) { // {name:newName,value:value}可重新指定参数 key:value
toArgs[keyOption.name ? keyOption.name : key] = keyOption.value; toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
} }
} else if (CALLBACKS.includes(key)) { } else if (CALLBACKS.indexOf(key) !== -1) {
toArgs[key] = processCallback(methodName, fromArgs[key], returnValue); toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
} else { } else {
if (!keepFromArgs) { if (!keepFromArgs) {
...@@ -345,10 +345,10 @@ function getData (vueOptions, context) { ...@@ -345,10 +345,10 @@ function getData (vueOptions, context) {
// 对 data 格式化 // 对 data 格式化
data = JSON.parse(JSON.stringify(data)); data = JSON.parse(JSON.stringify(data));
} catch (e) {} } catch (e) {}
} }
if (!isPlainObject(data)) { if (!isPlainObject(data)) {
data = {}; data = {};
} }
Object.keys(methods).forEach(methodName => { Object.keys(methods).forEach(methodName => {
...@@ -426,13 +426,13 @@ function getProperties (props, isBehavior = false) { ...@@ -426,13 +426,13 @@ function getProperties (props, isBehavior = false) {
value = value(); value = value();
} }
properties[key] = { properties[key] = {
type: PROP_TYPES.includes(opts.type) ? opts.type : null, type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
value, value,
observer: createObserver(key) observer: createObserver(key)
}; };
} else { // content:String } else { // content:String
properties[key] = { properties[key] = {
type: PROP_TYPES.includes(opts) ? opts : null, type: PROP_TYPES.indexOf(opts) !== -1 ? opts : null,
observer: createObserver(key) observer: createObserver(key)
}; };
} }
......
{ {
"name": "@dcloudio/uni-app-plus", "name": "@dcloudio/uni-app-plus",
"version": "0.0.222", "version": "0.0.223",
"description": "uni-app app-plus", "description": "uni-app app-plus",
"main": "dist/index.js", "main": "dist/index.js",
"scripts": { "scripts": {
......
...@@ -270,7 +270,7 @@ function processArgs (methodName, fromArgs, argsOption = {}, returnValue = {}, k ...@@ -270,7 +270,7 @@ function processArgs (methodName, fromArgs, argsOption = {}, returnValue = {}, k
} else if (isPlainObject(keyOption)) { // {name:newName,value:value}可重新指定参数 key:value } else if (isPlainObject(keyOption)) { // {name:newName,value:value}可重新指定参数 key:value
toArgs[keyOption.name ? keyOption.name : key] = keyOption.value; toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
} }
} else if (CALLBACKS.includes(key)) { } else if (CALLBACKS.indexOf(key) !== -1) {
toArgs[key] = processCallback(methodName, fromArgs[key], returnValue); toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
} else { } else {
if (!keepFromArgs) { if (!keepFromArgs) {
...@@ -480,10 +480,10 @@ function getData (vueOptions, context) { ...@@ -480,10 +480,10 @@ function getData (vueOptions, context) {
// 对 data 格式化 // 对 data 格式化
data = JSON.parse(JSON.stringify(data)); data = JSON.parse(JSON.stringify(data));
} catch (e) {} } catch (e) {}
} }
if (!isPlainObject(data)) { if (!isPlainObject(data)) {
data = {}; data = {};
} }
Object.keys(methods).forEach(methodName => { Object.keys(methods).forEach(methodName => {
...@@ -561,13 +561,13 @@ function getProperties (props, isBehavior = false) { ...@@ -561,13 +561,13 @@ function getProperties (props, isBehavior = false) {
value = value(); value = value();
} }
properties[key] = { properties[key] = {
type: PROP_TYPES.includes(opts.type) ? opts.type : null, type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
value, value,
observer: createObserver(key) observer: createObserver(key)
}; };
} else { // content:String } else { // content:String
properties[key] = { properties[key] = {
type: PROP_TYPES.includes(opts) ? opts : null, type: PROP_TYPES.indexOf(opts) !== -1 ? opts : null,
observer: createObserver(key) observer: createObserver(key)
}; };
} }
......
{ {
"name": "@dcloudio/uni-mp-baidu", "name": "@dcloudio/uni-mp-baidu",
"version": "0.0.817", "version": "0.0.818",
"description": "uni-app mp-baidu", "description": "uni-app mp-baidu",
"main": "dist/index.js", "main": "dist/index.js",
"scripts": { "scripts": {
......
...@@ -331,7 +331,7 @@ function processArgs (methodName, fromArgs, argsOption = {}, returnValue = {}, k ...@@ -331,7 +331,7 @@ function processArgs (methodName, fromArgs, argsOption = {}, returnValue = {}, k
} else if (isPlainObject(keyOption)) { // {name:newName,value:value}可重新指定参数 key:value } else if (isPlainObject(keyOption)) { // {name:newName,value:value}可重新指定参数 key:value
toArgs[keyOption.name ? keyOption.name : key] = keyOption.value; toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
} }
} else if (CALLBACKS.includes(key)) { } else if (CALLBACKS.indexOf(key) !== -1) {
toArgs[key] = processCallback(methodName, fromArgs[key], returnValue); toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
} else { } else {
if (!keepFromArgs) { if (!keepFromArgs) {
...@@ -525,10 +525,10 @@ function getData (vueOptions, context) { ...@@ -525,10 +525,10 @@ function getData (vueOptions, context) {
// 对 data 格式化 // 对 data 格式化
data = JSON.parse(JSON.stringify(data)); data = JSON.parse(JSON.stringify(data));
} catch (e) {} } catch (e) {}
} }
if (!isPlainObject(data)) { if (!isPlainObject(data)) {
data = {}; data = {};
} }
Object.keys(methods).forEach(methodName => { Object.keys(methods).forEach(methodName => {
...@@ -606,13 +606,13 @@ function getProperties (props, isBehavior = false) { ...@@ -606,13 +606,13 @@ function getProperties (props, isBehavior = false) {
value = value(); value = value();
} }
properties[key] = { properties[key] = {
type: PROP_TYPES.includes(opts.type) ? opts.type : null, type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
value, value,
observer: createObserver(key) observer: createObserver(key)
}; };
} else { // content:String } else { // content:String
properties[key] = { properties[key] = {
type: PROP_TYPES.includes(opts) ? opts : null, type: PROP_TYPES.indexOf(opts) !== -1 ? opts : null,
observer: createObserver(key) observer: createObserver(key)
}; };
} }
......
{ {
"name": "@dcloudio/uni-mp-toutiao", "name": "@dcloudio/uni-mp-toutiao",
"version": "0.0.317", "version": "0.0.318",
"description": "uni-app mp-toutiao", "description": "uni-app mp-toutiao",
"main": "dist/index.js", "main": "dist/index.js",
"scripts": { "scripts": {
......
...@@ -173,7 +173,7 @@ function processArgs (methodName, fromArgs, argsOption = {}, returnValue = {}, k ...@@ -173,7 +173,7 @@ function processArgs (methodName, fromArgs, argsOption = {}, returnValue = {}, k
} else if (isPlainObject(keyOption)) { // {name:newName,value:value}可重新指定参数 key:value } else if (isPlainObject(keyOption)) { // {name:newName,value:value}可重新指定参数 key:value
toArgs[keyOption.name ? keyOption.name : key] = keyOption.value; toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
} }
} else if (CALLBACKS.includes(key)) { } else if (CALLBACKS.indexOf(key) !== -1) {
toArgs[key] = processCallback(methodName, fromArgs[key], returnValue); toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
} else { } else {
if (!keepFromArgs) { if (!keepFromArgs) {
...@@ -372,10 +372,10 @@ function getData (vueOptions, context) { ...@@ -372,10 +372,10 @@ function getData (vueOptions, context) {
// 对 data 格式化 // 对 data 格式化
data = JSON.parse(JSON.stringify(data)); data = JSON.parse(JSON.stringify(data));
} catch (e) {} } catch (e) {}
} }
if (!isPlainObject(data)) { if (!isPlainObject(data)) {
data = {}; data = {};
} }
Object.keys(methods).forEach(methodName => { Object.keys(methods).forEach(methodName => {
...@@ -453,13 +453,13 @@ function getProperties (props, isBehavior = false) { ...@@ -453,13 +453,13 @@ function getProperties (props, isBehavior = false) {
value = value(); value = value();
} }
properties[key] = { properties[key] = {
type: PROP_TYPES.includes(opts.type) ? opts.type : null, type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
value, value,
observer: createObserver(key) observer: createObserver(key)
}; };
} else { // content:String } else { // content:String
properties[key] = { properties[key] = {
type: PROP_TYPES.includes(opts) ? opts : null, type: PROP_TYPES.indexOf(opts) !== -1 ? opts : null,
observer: createObserver(key) observer: createObserver(key)
}; };
} }
......
{ {
"name": "@dcloudio/uni-mp-weixin", "name": "@dcloudio/uni-mp-weixin",
"version": "0.0.941", "version": "0.0.942",
"description": "uni-app mp-weixin", "description": "uni-app mp-weixin",
"main": "dist/index.js", "main": "dist/index.js",
"scripts": { "scripts": {
......
...@@ -39,7 +39,7 @@ function processArgs (methodName, fromArgs, argsOption = {}, returnValue = {}, k ...@@ -39,7 +39,7 @@ function processArgs (methodName, fromArgs, argsOption = {}, returnValue = {}, k
} else if (isPlainObject(keyOption)) { // {name:newName,value:value}可重新指定参数 key:value } else if (isPlainObject(keyOption)) { // {name:newName,value:value}可重新指定参数 key:value
toArgs[keyOption.name ? keyOption.name : key] = keyOption.value toArgs[keyOption.name ? keyOption.name : key] = keyOption.value
} }
} else if (CALLBACKS.includes(key)) { } else if (CALLBACKS.indexOf(key) !== -1) {
toArgs[key] = processCallback(methodName, fromArgs[key], returnValue) toArgs[key] = processCallback(methodName, fromArgs[key], returnValue)
} else { } else {
if (!keepFromArgs) { if (!keepFromArgs) {
......
...@@ -41,10 +41,10 @@ export function getData (vueOptions, context) { ...@@ -41,10 +41,10 @@ export function getData (vueOptions, context) {
// 对 data 格式化 // 对 data 格式化
data = JSON.parse(JSON.stringify(data)) data = JSON.parse(JSON.stringify(data))
} catch (e) {} } catch (e) {}
} }
if (!isPlainObject(data)) { if (!isPlainObject(data)) {
data = {} data = {}
} }
Object.keys(methods).forEach(methodName => { Object.keys(methods).forEach(methodName => {
...@@ -122,13 +122,13 @@ export function getProperties (props, isBehavior = false) { ...@@ -122,13 +122,13 @@ export function getProperties (props, isBehavior = false) {
value = value() value = value()
} }
properties[key] = { properties[key] = {
type: PROP_TYPES.includes(opts.type) ? opts.type : null, type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
value, value,
observer: createObserver(key) observer: createObserver(key)
} }
} else { // content:String } else { // content:String
properties[key] = { properties[key] = {
type: PROP_TYPES.includes(opts) ? opts : null, type: PROP_TYPES.indexOf(opts) !== -1 ? opts : null,
observer: createObserver(key) observer: createObserver(key)
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册