Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wk1234123
uni-app
提交
21ed9546
uni-app
项目概览
wk1234123
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
21ed9546
编写于
4月 04, 2019
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
build uni-app-plus 0.0.207
上级
bd5d4c49
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
99 addition
and
14 deletion
+99
-14
packages/uni-app-plus/dist/index.js
packages/uni-app-plus/dist/index.js
+97
-12
packages/uni-app-plus/package.json
packages/uni-app-plus/package.json
+1
-1
packages/uni-mp-weixin/package.json
packages/uni-mp-weixin/package.json
+1
-1
未找到文件。
packages/uni-app-plus/dist/index.js
浏览文件 @
21ed9546
...
...
@@ -358,13 +358,84 @@ function wrapper$1 (event) {
return
event
}
function
processEventArgs
(
event
,
args
=
[],
isCustom
,
methodName
)
{
function
getExtraValue
(
vm
,
dataPathsArray
)
{
let
context
=
vm
;
dataPathsArray
.
forEach
(
dataPathArray
=>
{
const
dataPath
=
dataPathArray
[
0
];
const
value
=
dataPathArray
[
2
];
if
(
dataPath
||
typeof
value
!==
'
undefined
'
)
{
// ['','',index,'disable']
const
propPath
=
dataPathArray
[
1
];
const
valuePath
=
dataPathArray
[
3
];
const
vFor
=
dataPath
?
vm
.
__get_value
(
dataPath
,
context
)
:
context
;
if
(
Number
.
isInteger
(
vFor
))
{
context
=
value
;
}
else
if
(
!
propPath
)
{
context
=
vFor
[
value
];
}
else
{
if
(
Array
.
isArray
(
vFor
))
{
context
=
vFor
.
find
(
vForItem
=>
{
return
vm
.
__get_value
(
propPath
,
vForItem
)
===
value
});
}
else
if
(
isPlainObject
(
vFor
))
{
context
=
Object
.
keys
(
vFor
).
find
(
vForKey
=>
{
return
vm
.
__get_value
(
propPath
,
vFor
[
vForKey
])
===
value
});
}
else
{
console
.
error
(
'
v-for 暂不支持循环数据:
'
,
vFor
);
}
}
if
(
valuePath
)
{
context
=
vm
.
__get_value
(
valuePath
,
context
);
}
}
});
return
context
}
function
processEventExtra
(
vm
,
extra
)
{
const
extraObj
=
{};
if
(
Array
.
isArray
(
extra
)
&&
extra
.
length
)
{
/**
*[
* ['data.items', 'data.id', item.data.id],
* ['metas', 'id', meta.id]
*],
*[
* ['data.items', 'data.id', item.data.id],
* ['metas', 'id', meta.id]
*],
*'test'
*/
extra
.
forEach
((
dataPath
,
index
)
=>
{
if
(
typeof
dataPath
===
'
string
'
)
{
if
(
!
dataPath
)
{
// model,prop.sync
extraObj
[
'
$
'
+
index
]
=
vm
;
}
else
{
extraObj
[
'
$
'
+
index
]
=
vm
.
__get_value
(
dataPath
);
}
}
else
{
extraObj
[
'
$
'
+
index
]
=
getExtraValue
(
vm
,
dataPath
);
}
});
}
return
extraObj
}
function
processEventArgs
(
vm
,
event
,
args
=
[],
extra
=
[],
isCustom
,
methodName
)
{
if
(
isCustom
&&
!
args
.
length
)
{
// 无参数,直接传入 detail 数组
if
(
!
Array
.
isArray
(
event
.
detail
))
{
// 应该是使用了 wxcomponent 原生组件,为了向前兼容,传递原始 event 对象
return
[
event
]
}
return
event
.
detail
}
const
extraObj
=
processEventExtra
(
vm
,
extra
);
const
ret
=
[];
args
.
forEach
(
arg
=>
{
if
(
arg
===
'
$event
'
)
{
...
...
@@ -373,9 +444,13 @@ function processEventArgs (event, args = [], isCustom, methodName) {
}
else
{
ret
.
push
(
isCustom
?
event
.
detail
[
0
]
:
event
);
}
}
else
{
if
(
typeof
arg
===
'
string
'
&&
hasOwn
(
extraObj
,
arg
))
{
ret
.
push
(
extraObj
[
arg
]);
}
else
{
ret
.
push
(
arg
);
}
}
});
return
ret
...
...
@@ -407,6 +482,7 @@ function handleEvent (event) {
if
(
eventsArray
&&
eventType
===
type
)
{
eventsArray
.
forEach
(
eventArray
=>
{
const
methodName
=
eventArray
[
0
];
if
(
methodName
)
{
const
handler
=
this
.
$vm
[
methodName
];
if
(
!
isFn
(
handler
))
{
throw
new
Error
(
` _vm.
${
methodName
}
is not a function`
)
...
...
@@ -417,7 +493,15 @@ function handleEvent (event) {
}
handler
.
once
=
true
;
}
handler
.
apply
(
this
.
$vm
,
processEventArgs
(
event
,
eventArray
[
1
],
isCustom
,
methodName
));
handler
.
apply
(
this
.
$vm
,
processEventArgs
(
this
.
$vm
,
event
,
eventArray
[
1
],
eventArray
[
2
],
isCustom
,
methodName
));
}
});
}
});
...
...
@@ -481,6 +565,7 @@ function createApp (vm) {
const
appOptions
=
{
onLaunch
(
args
)
{
this
.
$vm
=
vm
;
this
.
$vm
.
_isMounted
=
true
;
...
...
packages/uni-app-plus/package.json
浏览文件 @
21ed9546
{
"name"
:
"@dcloudio/uni-app-plus"
,
"version"
:
"0.0.20
6
"
,
"version"
:
"0.0.20
7
"
,
"description"
:
"uni-app app-plus"
,
"main"
:
"dist/index.js"
,
"scripts"
:
{
...
...
packages/uni-mp-weixin/package.json
浏览文件 @
21ed9546
{
"name"
:
"@dcloudio/uni-mp-weixin"
,
"version"
:
"0.0.92
6
"
,
"version"
:
"0.0.92
7
"
,
"description"
:
"uni-app mp-weixin"
,
"main"
:
"dist/index.js"
,
"scripts"
:
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录