Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lzb_79
uni-app
提交
2f82156f
U
uni-app
项目概览
lzb_79
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2f82156f
编写于
3月 30, 2022
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(mp-alipay): 修复支付宝小程序插件内组件时机较早的事件无效的问题(question/142048)
上级
0fd4972f
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
46 addition
and
38 deletion
+46
-38
packages/uni-template-compiler/__tests__/compiler-mp-alipay.spec.js
...ni-template-compiler/__tests__/compiler-mp-alipay.spec.js
+1
-1
packages/uni-template-compiler/lib/script/traverse/data/index.js
...s/uni-template-compiler/lib/script/traverse/data/index.js
+7
-5
packages/webpack-uni-mp-loader/lib/plugin/generate-component.js
...es/webpack-uni-mp-loader/lib/plugin/generate-component.js
+1
-1
packages/webpack-uni-mp-loader/lib/plugin/index-new.js
packages/webpack-uni-mp-loader/lib/plugin/index-new.js
+1
-1
src/platforms/mp-alipay/runtime/wrapper/util.js
src/platforms/mp-alipay/runtime/wrapper/util.js
+36
-30
未找到文件。
packages/uni-template-compiler/__tests__/compiler-mp-alipay.spec.js
浏览文件 @
2f82156f
...
@@ -65,7 +65,7 @@ describe('mp:compiler-mp-alipay', () => {
...
@@ -65,7 +65,7 @@ describe('mp:compiler-mp-alipay', () => {
)
)
assertCodegen
(
assertCodegen
(
'
<credit-pay @change="onChange" @cancle="onCancle">text</credit-pay>
'
,
'
<credit-pay @change="onChange" @cancle="onCancle">text</credit-pay>
'
,
'
<plugin-wrapper onChange="__e" onCancle="__e" vue-id="551070e6-1" onPluginWrap="__w" data-event-opts="{{[[
\'
^change
\'
,[[
\'
onChange
\'
]]],[
\'
^cancle
\'
,[[
\'
onCancle
\'
]]]]}}" data-com-type="wx"
ref="__r"
data-event-list="onChange,onCancle" onVueInit="__l"><credit-pay onChange="{{
\'
onChange
\'
+
\'
551070e6-1
\'
}}" onCancle="{{
\'
onCancle
\'
+
\'
551070e6-1
\'
}}" onVueInit="__l">text</credit-pay></plugin-wrapper>
'
,
'
<plugin-wrapper onChange="__e" onCancle="__e" vue-id="551070e6-1" onPluginWrap="__w" data-event-opts="{{[[
\'
^change
\'
,[[
\'
onChange
\'
]]],[
\'
^cancle
\'
,[[
\'
onCancle
\'
]]]]}}" data-com-type="wx" data-event-list="onChange,onCancle" onVueInit="__l"><credit-pay onChange="{{
\'
onChange
\'
+
\'
551070e6-1
\'
}}" onCancle="{{
\'
onCancle
\'
+
\'
551070e6-1
\'
}}" onVueInit="__l">text</credit-pay></plugin-wrapper>
'
,
undefined
,
undefined
,
undefined
,
undefined
,
{
{
...
...
packages/uni-template-compiler/lib/script/traverse/data/index.js
浏览文件 @
2f82156f
...
@@ -52,12 +52,14 @@ module.exports = function traverseData (path, state, tagName) {
...
@@ -52,12 +52,14 @@ module.exports = function traverseData (path, state, tagName) {
)
)
)
)
if
(
state
.
options
.
platform
.
name
===
'
mp-alipay
'
)
{
if
(
state
.
options
.
platform
.
name
===
'
mp-alipay
'
)
{
if
(
!
wxComponent
.
startsWith
(
'
plugin://
'
))
{
addAttrProperties
.
push
(
addAttrProperties
.
push
(
t
.
objectProperty
(
t
.
objectProperty
(
t
.
stringLiteral
(
'
ref
'
),
t
.
stringLiteral
(
'
ref
'
),
t
.
stringLiteral
(
'
__r
'
)
t
.
stringLiteral
(
'
__r
'
)
)
)
)
)
}
const
on
=
path
.
node
.
properties
.
find
(
prop
=>
prop
.
key
.
name
===
'
on
'
)
const
on
=
path
.
node
.
properties
.
find
(
prop
=>
prop
.
key
.
name
===
'
on
'
)
if
(
on
)
{
if
(
on
)
{
const
properties
=
on
.
value
.
properties
const
properties
=
on
.
value
.
properties
...
...
packages/webpack-uni-mp-loader/lib/plugin/generate-component.js
浏览文件 @
2f82156f
...
@@ -253,7 +253,7 @@ module.exports = function generateComponent (compilation, jsonpFunction = 'webpa
...
@@ -253,7 +253,7 @@ module.exports = function generateComponent (compilation, jsonpFunction = 'webpa
},
},
{
{
ext
:
'
js
'
,
ext
:
'
js
'
,
source
:
'
Component({onInit(){this.props.onPluginWrap(this)},didUnmount(){this.props.onPluginWrap(this,
fals
e)}})
'
source
:
'
Component({onInit(){this.props.onPluginWrap(this)},didUnmount(){this.props.onPluginWrap(this,
tru
e)}})
'
},
},
{
{
ext
:
'
json
'
,
ext
:
'
json
'
,
...
...
packages/webpack-uni-mp-loader/lib/plugin/index-new.js
浏览文件 @
2f82156f
...
@@ -81,7 +81,7 @@ function addMPPluginRequire (compilation) {
...
@@ -81,7 +81,7 @@ function addMPPluginRequire (compilation) {
const
filePath
=
normalizePath
(
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
name
))
const
filePath
=
normalizePath
(
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
name
))
const
uniModuleId
=
modules
.
find
(
module
=>
module
.
resource
&&
normalizePath
(
module
.
resource
)
===
filePath
).
id
const
uniModuleId
=
modules
.
find
(
module
=>
module
.
resource
&&
normalizePath
(
module
.
resource
)
===
filePath
).
id
const
source
=
orignalSource
+
`\nmodule.exports =
${
globalEnv
}
.__webpack_require_UNI_MP_PLUGIN__('
${
uniModuleId
}
');\n`
;
const
source
=
orignalSource
+
`\nmodule.exports =
${
globalEnv
}
.__webpack_require_UNI_MP_PLUGIN__('
${
uniModuleId
}
');\n`
compilation
.
assets
[
name
]
=
{
compilation
.
assets
[
name
]
=
{
size
()
{
size
()
{
...
...
src/platforms/mp-alipay/runtime/wrapper/util.js
浏览文件 @
2f82156f
...
@@ -108,11 +108,7 @@ export function initChildVues (mpInstance) {
...
@@ -108,11 +108,7 @@ export function initChildVues (mpInstance) {
delete
mpInstance
.
_$childVues
delete
mpInstance
.
_$childVues
}
}
export
function
handleRef
(
ref
)
{
function
handleProps
(
ref
)
{
if
(
!
ref
)
{
return
}
if
(
ref
.
props
[
'
data-com-type
'
]
===
'
wx
'
)
{
const
eventProps
=
{}
const
eventProps
=
{}
let
refProps
=
ref
.
props
let
refProps
=
ref
.
props
const
eventList
=
refProps
[
'
data-event-list
'
].
split
(
'
,
'
)
const
eventList
=
refProps
[
'
data-event-list
'
].
split
(
'
,
'
)
...
@@ -142,6 +138,14 @@ export function handleRef (ref) {
...
@@ -142,6 +138,14 @@ export function handleRef (ref) {
refProps
=
Object
.
assign
(
value
,
eventProps
)
refProps
=
Object
.
assign
(
value
,
eventProps
)
}
}
})
})
}
export
function
handleRef
(
ref
)
{
if
(
!
ref
)
{
return
}
if
(
ref
.
props
[
'
data-com-type
'
]
===
'
wx
'
)
{
handleProps
(
ref
)
}
}
const
refName
=
ref
.
props
[
'
data-ref
'
]
const
refName
=
ref
.
props
[
'
data-ref
'
]
const
refInForName
=
ref
.
props
[
'
data-ref-in-for
'
]
const
refInForName
=
ref
.
props
[
'
data-ref-in-for
'
]
...
@@ -229,10 +233,12 @@ export const handleWrap = function (mp, destory) {
...
@@ -229,10 +233,12 @@ export const handleWrap = function (mp, destory) {
if
(
destory
)
{
if
(
destory
)
{
delete
this
[
key
]
delete
this
[
key
]
}
else
{
}
else
{
// TODO remove handleRef
this
[
key
]
=
function
()
{
this
[
key
]
=
function
()
{
mp
.
props
[
eventName
].
apply
(
this
,
arguments
)
mp
.
props
[
eventName
].
apply
(
this
,
arguments
)
}
}
}
}
})
})
if
(
!
destory
)
{
handleProps
(
mp
)
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录