Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
touchx
uni-app
提交
cdbb3031
U
uni-app
项目概览
touchx
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
0
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,发现更多精彩内容 >>
提交
cdbb3031
编写于
9月 27, 2022
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: init lifetimes hook use ExtendedVue options
上级
c07b5391
变更
21
显示空白变更内容
内联
并排
Showing
21 changed file
with
67 addition
and
92 deletion
+67
-92
src/core/runtime/wrapper/util.js
src/core/runtime/wrapper/util.js
+1
-1
src/platforms/app-plus/runtime/wrapper/component-parser.js
src/platforms/app-plus/runtime/wrapper/component-parser.js
+4
-4
src/platforms/mp-alipay/runtime/wrapper/component-parser.js
src/platforms/mp-alipay/runtime/wrapper/component-parser.js
+2
-2
src/platforms/mp-alipay/runtime/wrapper/page-parser.js
src/platforms/mp-alipay/runtime/wrapper/page-parser.js
+3
-3
src/platforms/mp-baidu/runtime/wrapper/component-parser.js
src/platforms/mp-baidu/runtime/wrapper/component-parser.js
+4
-4
src/platforms/mp-baidu/runtime/wrapper/page-parser.js
src/platforms/mp-baidu/runtime/wrapper/page-parser.js
+1
-9
src/platforms/mp-jd/runtime/wrapper/component-parser.js
src/platforms/mp-jd/runtime/wrapper/component-parser.js
+3
-3
src/platforms/mp-kuaishou/runtime/wrapper/component-parser.js
...platforms/mp-kuaishou/runtime/wrapper/component-parser.js
+3
-3
src/platforms/mp-lark/runtime/wrapper/component-parser.js
src/platforms/mp-lark/runtime/wrapper/component-parser.js
+6
-3
src/platforms/mp-lark/runtime/wrapper/page-parser.js
src/platforms/mp-lark/runtime/wrapper/page-parser.js
+2
-7
src/platforms/mp-qq/runtime/wrapper/component-parser.js
src/platforms/mp-qq/runtime/wrapper/component-parser.js
+3
-3
src/platforms/mp-toutiao/runtime/wrapper/component-parser.js
src/platforms/mp-toutiao/runtime/wrapper/component-parser.js
+6
-3
src/platforms/mp-toutiao/runtime/wrapper/page-parser.js
src/platforms/mp-toutiao/runtime/wrapper/page-parser.js
+2
-7
src/platforms/mp-weixin/runtime/wrapper/component-base-parser.js
...tforms/mp-weixin/runtime/wrapper/component-base-parser.js
+4
-1
src/platforms/mp-weixin/runtime/wrapper/component-parser.js
src/platforms/mp-weixin/runtime/wrapper/component-parser.js
+3
-3
src/platforms/mp-weixin/runtime/wrapper/page-base-parser.js
src/platforms/mp-weixin/runtime/wrapper/page-base-parser.js
+4
-10
src/platforms/mp-weixin/runtime/wrapper/page-parser.js
src/platforms/mp-weixin/runtime/wrapper/page-parser.js
+2
-10
src/platforms/mp-xhs/runtime/wrapper/component-parser.js
src/platforms/mp-xhs/runtime/wrapper/component-parser.js
+3
-3
src/platforms/mp-xhs/runtime/wrapper/page-parser.js
src/platforms/mp-xhs/runtime/wrapper/page-parser.js
+2
-2
src/platforms/quickapp-webview/runtime/wrapper/component-parser.js
...orms/quickapp-webview/runtime/wrapper/component-parser.js
+7
-4
src/platforms/quickapp-webview/runtime/wrapper/page-parser.js
...platforms/quickapp-webview/runtime/wrapper/page-parser.js
+2
-7
未找到文件。
src/core/runtime/wrapper/util.js
浏览文件 @
cdbb3031
...
@@ -50,7 +50,7 @@ function hasHook (hook, vueOptions) {
...
@@ -50,7 +50,7 @@ function hasHook (hook, vueOptions) {
return
false
return
false
}
}
if
(
isFn
(
vueOptions
[
hook
]))
{
if
(
isFn
(
vueOptions
[
hook
])
||
Array
.
isArray
(
vueOptions
[
hook
])
)
{
return
true
return
true
}
}
const
mixins
=
vueOptions
.
mixins
const
mixins
=
vueOptions
.
mixins
...
...
src/platforms/app-plus/runtime/wrapper/component-parser.js
浏览文件 @
cdbb3031
import
parseBaseComponent
from
'
../../../mp-weixin/runtime/wrapper/component-parser
'
import
parseBaseComponent
from
'
../../../mp-weixin/runtime/wrapper/component-parser
'
export
default
function
parseComponent
(
vueComponentOptions
)
{
export
default
function
parseComponent
(
vueComponentOptions
,
needVueOptions
)
{
const
componentOptions
=
parseBaseComponent
(
vueComponentOptions
)
const
[
componentOptions
,
vueOptions
]
=
parseBaseComponent
(
vueComponentOptions
,
true
)
componentOptions
.
methods
.
$getAppWebview
=
function
()
{
componentOptions
.
methods
.
$getAppWebview
=
function
()
{
return
plus
.
webview
.
getWebviewById
(
`
${
this
.
__wxWebviewId__
}
`
)
return
plus
.
webview
.
getWebviewById
(
`
${
this
.
__wxWebviewId__
}
`
)
}
}
return
componentOptions
return
needVueOptions
?
[
componentOptions
,
vueOptions
]
:
componentOptions
}
}
src/platforms/mp-alipay/runtime/wrapper/component-parser.js
浏览文件 @
cdbb3031
...
@@ -101,7 +101,7 @@ function initVm (VueComponent) {
...
@@ -101,7 +101,7 @@ function initVm (VueComponent) {
}
}
}
}
export
default
function
parseComponent
(
vueComponentOptions
)
{
export
default
function
parseComponent
(
vueComponentOptions
,
needVueOptions
)
{
const
[
VueComponent
,
vueOptions
]
=
initVueComponent
(
Vue
,
vueComponentOptions
)
const
[
VueComponent
,
vueOptions
]
=
initVueComponent
(
Vue
,
vueComponentOptions
)
const
properties
=
initProperties
(
vueOptions
.
props
,
false
,
vueOptions
.
__file
)
const
properties
=
initProperties
(
vueOptions
.
props
,
false
,
vueOptions
.
__file
)
...
@@ -164,5 +164,5 @@ export default function parseComponent (vueComponentOptions) {
...
@@ -164,5 +164,5 @@ export default function parseComponent (vueComponentOptions) {
})
})
}
}
return
componentOptions
return
needVueOptions
?
[
componentOptions
,
vueOptions
]
:
componentOptions
}
}
src/platforms/mp-alipay/runtime/wrapper/page-parser.js
浏览文件 @
cdbb3031
...
@@ -93,10 +93,10 @@ export default function parsePage (vuePageOptions) {
...
@@ -93,10 +93,10 @@ export default function parsePage (vuePageOptions) {
triggerEvent
triggerEvent
}
}
Object
.
assign
(
pageOptions
.
events
,
vue
Page
Options
.
events
||
{})
Object
.
assign
(
pageOptions
.
events
,
vueOptions
.
events
||
{})
initHooks
(
pageOptions
,
hooks
,
vue
Page
Options
)
initHooks
(
pageOptions
,
hooks
,
vueOptions
)
initUnknownHooks
(
pageOptions
,
vue
Page
Options
,
[
'
onReady
'
])
initUnknownHooks
(
pageOptions
,
vueOptions
,
[
'
onReady
'
])
if
(
Array
.
isArray
(
vueOptions
.
wxsCallMethods
))
{
if
(
Array
.
isArray
(
vueOptions
.
wxsCallMethods
))
{
vueOptions
.
wxsCallMethods
.
forEach
(
callMethod
=>
{
vueOptions
.
wxsCallMethods
.
forEach
(
callMethod
=>
{
...
...
src/platforms/mp-baidu/runtime/wrapper/component-parser.js
浏览文件 @
cdbb3031
...
@@ -25,11 +25,11 @@ import parseBaseComponent from '../../../mp-weixin/runtime/wrapper/component-bas
...
@@ -25,11 +25,11 @@ import parseBaseComponent from '../../../mp-weixin/runtime/wrapper/component-bas
const
newLifecycle
=
swan
.
canIUse
(
'
lifecycle-2-0
'
)
const
newLifecycle
=
swan
.
canIUse
(
'
lifecycle-2-0
'
)
export
default
function
parseComponent
(
vueOptions
)
{
export
default
function
parseComponent
(
vue
ComponentOptions
,
needVue
Options
)
{
const
componentOptions
=
parseBaseComponent
(
vue
Options
,
{
const
[
componentOptions
,
vueOptions
]
=
parseBaseComponent
(
vueComponent
Options
,
{
isPage
,
isPage
,
initRelation
initRelation
})
}
,
true
)
// 关于百度小程序生命周期的说明(组件作为页面时):
// 关于百度小程序生命周期的说明(组件作为页面时):
// lifetimes:attached --> methods:onShow --> methods:onLoad --> methods:onReady
// lifetimes:attached --> methods:onShow --> methods:onLoad --> methods:onReady
...
@@ -90,5 +90,5 @@ export default function parseComponent (vueOptions) {
...
@@ -90,5 +90,5 @@ export default function parseComponent (vueOptions) {
}
}
delete
componentOptions
.
methods
.
__l
delete
componentOptions
.
methods
.
__l
return
componentOptions
return
needVueOptions
?
[
componentOptions
,
vueOptions
]
:
componentOptions
}
}
src/platforms/mp-baidu/runtime/wrapper/page-parser.js
浏览文件 @
cdbb3031
...
@@ -2,11 +2,6 @@ import {
...
@@ -2,11 +2,6 @@ import {
stringifyQuery
stringifyQuery
}
from
'
uni-shared/query
'
}
from
'
uni-shared/query
'
import
{
isPage
,
initRelation
}
from
'
./util
'
import
parseBasePage
from
'
../../../mp-weixin/runtime/wrapper/page-base-parser
'
import
parseBasePage
from
'
../../../mp-weixin/runtime/wrapper/page-base-parser
'
function
detached
(
$vm
)
{
function
detached
(
$vm
)
{
...
@@ -24,10 +19,7 @@ function onPageUnload ($vm) {
...
@@ -24,10 +19,7 @@ function onPageUnload ($vm) {
}
}
export
default
function
parsePage
(
vuePageOptions
)
{
export
default
function
parsePage
(
vuePageOptions
)
{
const
pageOptions
=
parseBasePage
(
vuePageOptions
,
{
const
pageOptions
=
parseBasePage
(
vuePageOptions
)
isPage
,
initRelation
})
// 纠正百度小程序生命周期methods:onShow在methods:onLoad之前触发的问题
// 纠正百度小程序生命周期methods:onShow在methods:onLoad之前触发的问题
pageOptions
.
methods
.
onShow
=
function
onShow
()
{
pageOptions
.
methods
.
onShow
=
function
onShow
()
{
...
...
src/platforms/mp-jd/runtime/wrapper/component-parser.js
浏览文件 @
cdbb3031
import
parseBaseComponent
from
'
../../../mp-weixin/runtime/wrapper/component-parser
'
import
parseBaseComponent
from
'
../../../mp-weixin/runtime/wrapper/component-parser
'
export
default
function
parseComponent
(
vueComponentOptions
)
{
export
default
function
parseComponent
(
vueComponentOptions
,
needVueOptions
)
{
const
componentOptions
=
parseBaseComponent
(
vueComponentOptions
)
const
[
componentOptions
,
vueOptions
]
=
parseBaseComponent
(
vueComponentOptions
,
true
)
// 京东小程序 lifetimes 存在兼容问题
// 京东小程序 lifetimes 存在兼容问题
const
lifetimes
=
componentOptions
.
lifetimes
const
lifetimes
=
componentOptions
.
lifetimes
Object
.
keys
(
lifetimes
).
forEach
(
key
=>
{
Object
.
keys
(
lifetimes
).
forEach
(
key
=>
{
componentOptions
[
key
]
=
lifetimes
[
key
]
componentOptions
[
key
]
=
lifetimes
[
key
]
})
})
return
componentOptions
return
needVueOptions
?
[
componentOptions
,
vueOptions
]
:
componentOptions
}
}
src/platforms/mp-kuaishou/runtime/wrapper/component-parser.js
浏览文件 @
cdbb3031
...
@@ -7,8 +7,8 @@ import {
...
@@ -7,8 +7,8 @@ import {
fixSetDataEnd
fixSetDataEnd
}
from
'
../../../mp-weixin/runtime/wrapper/fix-set-data
'
}
from
'
../../../mp-weixin/runtime/wrapper/fix-set-data
'
export
default
function
parseComponent
(
vueComponentOptions
)
{
export
default
function
parseComponent
(
vueComponentOptions
,
needVueOptions
)
{
const
componentOptions
=
parseBaseComponent
(
vueComponentOptions
)
const
[
componentOptions
,
vueOptions
]
=
parseBaseComponent
(
vueComponentOptions
,
true
)
const
oldAttached
=
componentOptions
.
lifetimes
.
attached
const
oldAttached
=
componentOptions
.
lifetimes
.
attached
componentOptions
.
lifetimes
.
attached
=
function
attached
()
{
componentOptions
.
lifetimes
.
attached
=
function
attached
()
{
// 暂不区分版本
// 暂不区分版本
...
@@ -21,5 +21,5 @@ export default function parseComponent (vueComponentOptions) {
...
@@ -21,5 +21,5 @@ export default function parseComponent (vueComponentOptions) {
}
}
oldAttached
.
call
(
this
)
oldAttached
.
call
(
this
)
}
}
return
componentOptions
return
needVueOptions
?
[
componentOptions
,
vueOptions
]
:
componentOptions
}
}
src/platforms/mp-lark/runtime/wrapper/component-parser.js
浏览文件 @
cdbb3031
...
@@ -11,8 +11,11 @@ import {
...
@@ -11,8 +11,11 @@ import {
import
parseBaseComponent
from
'
../../../mp-weixin/runtime/wrapper/component-base-parser
'
import
parseBaseComponent
from
'
../../../mp-weixin/runtime/wrapper/component-base-parser
'
export
default
function
parseComponent
(
vueOptions
)
{
export
default
function
parseComponent
(
vueComponentOptions
,
needVueOptions
)
{
const
[
componentOptions
,
VueComponent
]
=
parseBaseComponent
(
vueOptions
)
const
[
componentOptions
,
vueOptions
,
VueComponent
]
=
parseBaseComponent
(
vueComponentOptions
,
{
isPage
,
initRelation
},
true
)
componentOptions
.
lifetimes
.
attached
=
function
attached
()
{
componentOptions
.
lifetimes
.
attached
=
function
attached
()
{
const
properties
=
this
.
properties
const
properties
=
this
.
properties
...
@@ -46,5 +49,5 @@ export default function parseComponent (vueOptions) {
...
@@ -46,5 +49,5 @@ export default function parseComponent (vueOptions) {
componentOptions
.
methods
.
__l
=
handleLink
componentOptions
.
methods
.
__l
=
handleLink
return
componentOptions
return
needVueOptions
?
[
componentOptions
,
vueOptions
]
:
componentOptions
}
}
src/platforms/mp-lark/runtime/wrapper/page-parser.js
浏览文件 @
cdbb3031
import
{
import
{
isPage
,
instances
instances
,
initRelation
}
from
'
./util
'
}
from
'
./util
'
import
parseBasePage
from
'
../../../mp-weixin/runtime/wrapper/page-base-parser
'
import
parseBasePage
from
'
../../../mp-weixin/runtime/wrapper/page-base-parser
'
export
default
function
parsePage
(
vuePageOptions
)
{
export
default
function
parsePage
(
vuePageOptions
)
{
const
pageOptions
=
parseBasePage
(
vuePageOptions
,
{
const
pageOptions
=
parseBasePage
(
vuePageOptions
)
isPage
,
initRelation
})
// 页面需要在 ready 中触发,其他组件是在 handleLink 中触发
// 页面需要在 ready 中触发,其他组件是在 handleLink 中触发
pageOptions
.
lifetimes
.
ready
=
function
ready
()
{
pageOptions
.
lifetimes
.
ready
=
function
ready
()
{
if
(
this
.
$vm
&&
this
.
$vm
.
mpType
===
'
page
'
)
{
if
(
this
.
$vm
&&
this
.
$vm
.
mpType
===
'
page
'
)
{
...
...
src/platforms/mp-qq/runtime/wrapper/component-parser.js
浏览文件 @
cdbb3031
import
parseBaseComponent
from
'
../../../mp-weixin/runtime/wrapper/component-parser
'
import
parseBaseComponent
from
'
../../../mp-weixin/runtime/wrapper/component-parser
'
export
default
function
parseComponent
(
vueComponentOptions
)
{
export
default
function
parseComponent
(
vueComponentOptions
,
needVueOptions
)
{
return
parseBaseComponent
(
vueComponentOptions
)
return
parseBaseComponent
(
vueComponentOptions
,
needVueOptions
)
}
}
src/platforms/mp-toutiao/runtime/wrapper/component-parser.js
浏览文件 @
cdbb3031
...
@@ -20,8 +20,11 @@ function currentComponents (mpInstance, callback) {
...
@@ -20,8 +20,11 @@ function currentComponents (mpInstance, callback) {
}
}
}
}
export
default
function
parseComponent
(
vueOptions
)
{
export
default
function
parseComponent
(
vueComponentOptions
,
needVueOptions
)
{
const
[
componentOptions
,
VueComponent
]
=
parseBaseComponent
(
vueOptions
)
const
[
componentOptions
,
vueOptions
,
VueComponent
]
=
parseBaseComponent
(
vueComponentOptions
,
{
isPage
,
initRelation
},
true
)
const
lifetimes
=
componentOptions
.
lifetimes
const
lifetimes
=
componentOptions
.
lifetimes
// 基础库 2.0 以上 attached 顺序错乱,按照 created 顺序强制纠正
// 基础库 2.0 以上 attached 顺序错乱,按照 created 顺序强制纠正
...
@@ -87,5 +90,5 @@ export default function parseComponent (vueOptions) {
...
@@ -87,5 +90,5 @@ export default function parseComponent (vueOptions) {
componentOptions
.
methods
.
__l
=
handleLink
componentOptions
.
methods
.
__l
=
handleLink
return
componentOptions
return
needVueOptions
?
[
componentOptions
,
vueOptions
]
:
componentOptions
}
}
src/platforms/mp-toutiao/runtime/wrapper/page-parser.js
浏览文件 @
cdbb3031
import
{
import
{
isPage
,
instances
,
instances
,
components
,
components
initRelation
}
from
'
./util
'
}
from
'
./util
'
import
parseBasePage
from
'
../../../mp-weixin/runtime/wrapper/page-base-parser
'
import
parseBasePage
from
'
../../../mp-weixin/runtime/wrapper/page-base-parser
'
export
default
function
parsePage
(
vuePageOptions
)
{
export
default
function
parsePage
(
vuePageOptions
)
{
const
pageOptions
=
parseBasePage
(
vuePageOptions
,
{
const
pageOptions
=
parseBasePage
(
vuePageOptions
)
isPage
,
initRelation
})
const
lifetimes
=
pageOptions
.
lifetimes
const
lifetimes
=
pageOptions
.
lifetimes
const
oldCreated
=
lifetimes
.
created
const
oldCreated
=
lifetimes
.
created
lifetimes
.
created
=
function
created
()
{
lifetimes
.
created
=
function
created
()
{
...
...
src/platforms/mp-weixin/runtime/wrapper/component-base-parser.js
浏览文件 @
cdbb3031
...
@@ -18,7 +18,7 @@ import {
...
@@ -18,7 +18,7 @@ import {
export
default
function
parseBaseComponent
(
vueComponentOptions
,
{
export
default
function
parseBaseComponent
(
vueComponentOptions
,
{
isPage
,
isPage
,
initRelation
initRelation
}
=
{})
{
}
=
{}
,
needVueOptions
)
{
const
[
VueComponent
,
vueOptions
]
=
initVueComponent
(
Vue
,
vueComponentOptions
)
const
[
VueComponent
,
vueOptions
]
=
initVueComponent
(
Vue
,
vueComponentOptions
)
const
options
=
{
const
options
=
{
...
@@ -110,6 +110,9 @@ export default function parseBaseComponent (vueComponentOptions, {
...
@@ -110,6 +110,9 @@ export default function parseBaseComponent (vueComponentOptions, {
})
})
}
}
if
(
needVueOptions
)
{
return
[
componentOptions
,
vueOptions
,
VueComponent
]
}
if
(
isPage
)
{
if
(
isPage
)
{
return
componentOptions
return
componentOptions
}
}
...
...
src/platforms/mp-weixin/runtime/wrapper/component-parser.js
浏览文件 @
cdbb3031
...
@@ -5,9 +5,9 @@ import {
...
@@ -5,9 +5,9 @@ import {
initRelation
initRelation
}
from
'
./util
'
}
from
'
./util
'
export
default
function
parseComponent
(
vueComponentOptions
)
{
export
default
function
parseComponent
(
vueComponentOptions
,
needVueOptions
)
{
return
parseBaseComponent
(
vueComponentOptions
,
{
return
parseBaseComponent
(
vueComponentOptions
,
{
isPage
,
isPage
,
initRelation
initRelation
})
}
,
needVueOptions
)
}
}
src/platforms/mp-weixin/runtime/wrapper/page-base-parser.js
浏览文件 @
cdbb3031
...
@@ -18,16 +18,10 @@ const hooks = [
...
@@ -18,16 +18,10 @@ const hooks = [
hooks
.
push
(...
PAGE_EVENT_HOOKS
)
hooks
.
push
(...
PAGE_EVENT_HOOKS
)
export
default
function
parseBasePage
(
vuePageOptions
,
{
export
default
function
parseBasePage
(
vuePageOptions
)
{
isPage
,
const
[
pageOptions
,
vueOptions
]
=
parseComponent
(
vuePageOptions
,
true
)
initRelation
})
{
initHooks
(
pageOptions
.
methods
,
hooks
,
vueOptions
)
const
pageOptions
=
parseComponent
(
vuePageOptions
,
{
isPage
,
initRelation
})
initHooks
(
pageOptions
.
methods
,
hooks
,
vuePageOptions
)
pageOptions
.
methods
.
onLoad
=
function
(
query
)
{
pageOptions
.
methods
.
onLoad
=
function
(
query
)
{
this
.
options
=
query
this
.
options
=
query
...
...
src/platforms/mp-weixin/runtime/wrapper/page-parser.js
浏览文件 @
cdbb3031
import
parseBasePage
from
'
./page-base-parser
'
import
parseBasePage
from
'
./page-base-parser
'
import
{
isPage
,
initRelation
}
from
'
./util
'
export
default
function
parsePage
(
vuePageOptions
)
{
export
default
function
parsePage
(
vuePageOptions
)
{
return
parseBasePage
(
vuePageOptions
,
{
return
parseBasePage
(
vuePageOptions
)
isPage
,
initRelation
})
}
}
src/platforms/mp-xhs/runtime/wrapper/component-parser.js
浏览文件 @
cdbb3031
...
@@ -19,8 +19,8 @@ import {
...
@@ -19,8 +19,8 @@ import {
fixSetDataEnd
fixSetDataEnd
}
from
'
../../../mp-weixin/runtime/wrapper/fix-set-data
'
}
from
'
../../../mp-weixin/runtime/wrapper/fix-set-data
'
export
default
function
parseComponent
(
vueComponentOptions
)
{
export
default
function
parseComponent
(
vueComponentOptions
,
needVueOptions
)
{
const
componentOptions
=
parseBaseComponent
(
vueComponentOptions
)
const
[
componentOptions
,
vueOptions
]
=
parseBaseComponent
(
vueComponentOptions
,
true
)
const
oldAttached
=
componentOptions
.
lifetimes
.
attached
const
oldAttached
=
componentOptions
.
lifetimes
.
attached
componentOptions
.
lifetimes
.
attached
=
function
attached
()
{
componentOptions
.
lifetimes
.
attached
=
function
attached
()
{
// 暂不区分版本
// 暂不区分版本
...
@@ -32,5 +32,5 @@ export default function parseComponent (vueComponentOptions) {
...
@@ -32,5 +32,5 @@ export default function parseComponent (vueComponentOptions) {
}
}
oldAttached
.
call
(
this
)
oldAttached
.
call
(
this
)
}
}
return
componentOptions
return
needVueOptions
?
[
componentOptions
,
vueOptions
]
:
componentOptions
}
}
src/platforms/mp-xhs/runtime/wrapper/page-parser.js
浏览文件 @
cdbb3031
...
@@ -80,8 +80,8 @@ export default function parsePage (vuePageOptions) {
...
@@ -80,8 +80,8 @@ export default function parsePage (vuePageOptions) {
triggerEvent
:
function
noop
()
{}
triggerEvent
:
function
noop
()
{}
}
}
initHooks
(
pageOptions
,
hooks
,
vue
Page
Options
)
initHooks
(
pageOptions
,
hooks
,
vueOptions
)
initUnknownHooks
(
pageOptions
,
vue
Page
Options
,
[
'
onReady
'
])
initUnknownHooks
(
pageOptions
,
vueOptions
,
[
'
onReady
'
])
if
(
Array
.
isArray
(
vueOptions
.
wxsCallMethods
))
{
if
(
Array
.
isArray
(
vueOptions
.
wxsCallMethods
))
{
vueOptions
.
wxsCallMethods
.
forEach
(
callMethod
=>
{
vueOptions
.
wxsCallMethods
.
forEach
(
callMethod
=>
{
...
...
src/platforms/quickapp-webview/runtime/wrapper/component-parser.js
浏览文件 @
cdbb3031
...
@@ -11,8 +11,11 @@ import {
...
@@ -11,8 +11,11 @@ import {
import
parseBaseComponent
from
'
../../../mp-weixin/runtime/wrapper/component-base-parser
'
import
parseBaseComponent
from
'
../../../mp-weixin/runtime/wrapper/component-base-parser
'
export
default
function
parseComponent
(
vueOptions
)
{
export
default
function
parseComponent
(
vueComponentOptions
,
needVueOptions
)
{
const
[
componentOptions
,
VueComponent
]
=
parseBaseComponent
(
vueOptions
)
const
[
componentOptions
,
vueOptions
,
VueComponent
]
=
parseBaseComponent
(
vueComponentOptions
,
{
isPage
,
initRelation
},
true
)
componentOptions
.
lifetimes
.
attached
=
function
attached
()
{
componentOptions
.
lifetimes
.
attached
=
function
attached
()
{
const
properties
=
this
.
properties
const
properties
=
this
.
properties
...
@@ -46,5 +49,5 @@ export default function parseComponent (vueOptions) {
...
@@ -46,5 +49,5 @@ export default function parseComponent (vueOptions) {
componentOptions
.
methods
.
__l
=
handleLink
componentOptions
.
methods
.
__l
=
handleLink
return
componentOptions
return
needVueOptions
?
[
componentOptions
,
vueOptions
]
:
componentOptions
}
}
src/platforms/quickapp-webview/runtime/wrapper/page-parser.js
浏览文件 @
cdbb3031
import
{
import
{
isPage
,
instances
instances
,
initRelation
}
from
'
./util
'
}
from
'
./util
'
import
parseBasePage
from
'
../../../mp-weixin/runtime/wrapper/page-base-parser
'
import
parseBasePage
from
'
../../../mp-weixin/runtime/wrapper/page-base-parser
'
export
default
function
parsePage
(
vuePageOptions
)
{
export
default
function
parsePage
(
vuePageOptions
)
{
const
pageOptions
=
parseBasePage
(
vuePageOptions
,
{
const
pageOptions
=
parseBasePage
(
vuePageOptions
)
isPage
,
initRelation
})
// 页面需要在 ready 中触发,其他组件是在 handleLink 中触发
// 页面需要在 ready 中触发,其他组件是在 handleLink 中触发
pageOptions
.
lifetimes
.
ready
=
function
ready
()
{
pageOptions
.
lifetimes
.
ready
=
function
ready
()
{
if
(
this
.
$vm
&&
this
.
$vm
.
mpType
===
'
page
'
)
{
if
(
this
.
$vm
&&
this
.
$vm
.
mpType
===
'
page
'
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录