Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wk1234123
uni-app
提交
426bef31
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,体验更适合开发者的 AI 搜索 >>
提交
426bef31
编写于
7月 14, 2020
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' into alpha
上级
d24afd7c
4152e38b
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
16 addition
and
14 deletion
+16
-14
packages/webpack-uni-mp-loader/lib/plugin/generate-component.js
...es/webpack-uni-mp-loader/lib/plugin/generate-component.js
+2
-1
src/core/runtime/event-bus.js
src/core/runtime/event-bus.js
+0
-4
src/core/runtime/wrapper/util.js
src/core/runtime/wrapper/util.js
+14
-9
未找到文件。
packages/webpack-uni-mp-loader/lib/plugin/generate-component.js
浏览文件 @
426bef31
...
...
@@ -128,7 +128,8 @@ module.exports = function generateComponent (compilation) {
}
if
(
name
.
endsWith
(
'
.wxss
'
))
{
// 移除部分含有错误引用的 wxss 文件
const
origSource
=
assets
[
name
].
source
().
trim
()
let
origSource
=
assets
[
name
].
source
()
origSource
=
origSource
.
trim
?
origSource
.
trim
()
:
''
const
result
=
origSource
.
match
(
/^@import
[
"'
](
.+
?)[
"'
]
$/
)
if
(
result
)
{
const
wxssPath
=
path
.
join
(
path
.
dirname
(
name
),
result
[
1
])
...
...
src/core/runtime/event-bus.js
浏览文件 @
426bef31
import
Vue
from
'
vue
'
const
getEmitter
=
(
function
()
{
if
(
typeof
getUniEmitter
===
'
function
'
)
{
/* eslint-disable no-undef */
return
getUniEmitter
}
let
Emitter
return
function
getUniEmitter
()
{
if
(
!
Emitter
)
{
...
...
src/core/runtime/wrapper/util.js
浏览文件 @
426bef31
...
...
@@ -9,8 +9,8 @@ import {
export
const
PAGE_EVENT_HOOKS
=
[
'
onPullDownRefresh
'
,
'
onReachBottom
'
,
'
onAddToFavorites
'
,
'
onReachBottom
'
,
'
onAddToFavorites
'
,
'
onShareTimeline
'
,
'
onShareAppMessage
'
,
'
onPageScroll
'
,
...
...
@@ -471,6 +471,15 @@ function isMatchEventType (eventType, optType) {
)
}
function
getContextVm
(
vm
)
{
let
$parent
=
vm
.
$parent
// 父组件是 scoped slots 或者其他自定义组件时继续查找
while
(
$parent
&&
$parent
.
$parent
&&
(
$parent
.
$options
.
generic
||
$parent
.
$parent
.
$options
.
generic
||
$parent
.
$scope
.
_$vuePid
))
{
$parent
=
$parent
.
$parent
}
return
$parent
&&
$parent
.
$parent
}
export
function
handleEvent
(
event
)
{
event
=
wrapper
(
event
)
...
...
@@ -503,12 +512,8 @@ export function handleEvent (event) {
const
methodName
=
eventArray
[
0
]
if
(
methodName
)
{
let
handlerCtx
=
this
.
$vm
if
(
handlerCtx
.
$options
.
generic
&&
handlerCtx
.
$parent
&&
handlerCtx
.
$parent
.
$parent
)
{
// mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
handlerCtx
=
handlerCtx
.
$parent
.
$parent
if
(
handlerCtx
.
$options
.
generic
)
{
// mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
handlerCtx
=
getContextVm
(
handlerCtx
)
||
handlerCtx
}
if
(
methodName
===
'
$emit
'
)
{
handlerCtx
.
$emit
.
apply
(
handlerCtx
,
...
...
@@ -552,4 +557,4 @@ export function handleEvent (event) {
)
{
return
ret
[
0
]
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录