Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
我本凡人 一念云泥
uni-app
提交
970a999f
uni-app
项目概览
我本凡人 一念云泥
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
4
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,发现更多精彩内容 >>
提交
970a999f
编写于
1月 16, 2020
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' into alpha
上级
67558a1d
6b8c18e2
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
48 addition
and
19 deletion
+48
-19
packages/uni-template-compiler/lib/app/parser/component-parser.js
.../uni-template-compiler/lib/app/parser/component-parser.js
+3
-3
packages/uni-template-compiler/lib/app/parser/tag-parser.js
packages/uni-template-compiler/lib/app/parser/tag-parser.js
+2
-7
packages/vue-cli-plugin-uni/packages/vue-loader/lib/index.js
packages/vue-cli-plugin-uni/packages/vue-loader/lib/index.js
+1
-1
packages/webpack-uni-pages-loader/lib/platforms/app-plus/index.v3.js
...bpack-uni-pages-loader/lib/platforms/app-plus/index.v3.js
+7
-5
src/platforms/app-plus/view/mixins/native.js
src/platforms/app-plus/view/mixins/native.js
+35
-3
未找到文件。
packages/uni-template-compiler/lib/app/parser/component-parser.js
浏览文件 @
970a999f
...
...
@@ -10,10 +10,10 @@ const {
module
.
exports
=
function
parseComponent
(
el
)
{
// 需要把自定义组件的 attrs, props 全干掉
if
(
el
.
tag
&&
isComponent
(
el
.
tag
))
{
// 仅保留
ID
// 仅保留
id、ID、data
el
.
attrs
&&
(
el
.
attrs
=
el
.
attrs
.
filter
(
attr
=>
{
const
name
=
attr
.
name
return
name
===
ID
||
name
.
indexOf
(
'
data-
'
)
===
0
return
name
===
'
id
'
||
name
===
ID
||
name
.
indexOf
(
'
data-
'
)
===
0
}))
}
}
}
packages/uni-template-compiler/lib/app/parser/tag-parser.js
浏览文件 @
970a999f
...
...
@@ -2,16 +2,11 @@ const {
hasOwn
}
=
require
(
'
../util
'
)
const
{
getTagName
}
=
require
(
'
../../h5
'
)
const
tags
=
require
(
'
@dcloudio/uni-cli-shared/lib/tags
'
)
const
tags
=
require
(
'
@dcloudio/uni-cli-shared/lib/tags
'
)
// 仅限 view 层
module
.
exports
=
function
parseTag
(
el
)
{
el
.
tag
=
getTagName
(
el
.
tag
)
if
(
el
.
tag
.
indexOf
(
'
v-uni-
'
)
!==
0
&&
hasOwn
(
tags
,
el
.
tag
))
{
el
.
tag
=
'
v-uni-
'
+
el
.
tag
}
}
}
packages/vue-cli-plugin-uni/packages/vue-loader/lib/index.js
浏览文件 @
970a999f
...
...
@@ -79,7 +79,7 @@ module.exports = function (source) {
const
isWin
=
/^win/
.
test
(
process
.
platform
)
const
normalizePath
=
path
=>
(
isWin
?
path
.
replace
(
/
\\
/g
,
'
/
'
)
:
path
)
if
(
options
.
compilerOptions
){
if
(
!
options
.
compilerOptions
){
options
.
compilerOptions
=
{}
}
options
.
compilerOptions
.
autoComponentResourcePath
=
normalizePath
(
resourcePath
)
...
...
packages/webpack-uni-pages-loader/lib/platforms/app-plus/index.v3.js
浏览文件 @
970a999f
...
...
@@ -82,13 +82,15 @@ module.exports = function (appJson, manifestJson, {
// 删除首页 style 中的 uni-app 配置(不注入 app-view.js)
delete
manifestJson
.
plus
.
launchwebview
[
'
uni-app
'
]
if
(
appJson
.
page
[
appJson
.
entryPagePath
].
nvue
)
{
// 首页是 nvue
const
entryPagePath
=
appJson
.
entryPagePath
if
(
appJson
.
page
[
entryPagePath
].
nvue
)
{
// 首页是 nvue
manifestJson
.
launch_path
=
''
// 首页地址为空
manifestJson
.
plus
.
launchwebview
.
uniNView
=
{
path
:
appJson
.
entryPagePath
+
'
.js
'
+
(
appJson
.
entryPageQuery
||
''
)
path
:
entryPagePath
+
'
.js
'
+
(
appJson
.
entryPageQuery
||
''
)
}
if
(
manifestJson
.
plus
.
tabBar
)
{
manifestJson
.
plus
.
tabBar
.
child
=
[
'
lauchwebview
'
]
const
tabBar
=
manifestJson
.
plus
.
tabBar
if
(
isTabBarPage
(
entryPagePath
,
tabBar
.
list
))
{
tabBar
.
child
=
[
'
lauchwebview
'
]
}
}
else
{
manifestJson
.
plus
.
launch_path
=
'
__uniappview.html
'
// 首页地址固定
...
...
@@ -102,4 +104,4 @@ module.exports = function (appJson, manifestJson, {
manifest
.
content
=
JSON
.
stringify
(
manifest
.
content
)
delete
appJson
.
nvue
return
[
manifest
,
definePages
(
appJson
),
appConfigService
(
appJson
)]
}
}
src/platforms/app-plus/view/mixins/native.js
浏览文件 @
970a999f
const
TITLEBAR_HEIGHT
=
44
function
getStatusbarHeight
()
{
// 横屏时 iOS 获取的状态栏高度错误,进行纠正
return
plus
.
navigator
.
isImmersedStatusbar
()
?
Math
.
round
(
plus
.
os
.
name
===
'
iOS
'
?
plus
.
navigator
.
getSafeAreaInsets
().
top
:
plus
.
navigator
.
getStatusbarHeight
())
:
0
}
function
getNavigationBarHeight
()
{
const
webview
=
plus
.
webview
.
currentWebview
()
let
style
=
webview
.
getStyle
()
style
=
style
&&
style
.
titleNView
if
(
style
&&
style
.
type
===
'
default
'
)
{
return
TITLEBAR_HEIGHT
+
getStatusbarHeight
()
}
return
0
}
function
getFixed
(
$el
)
{
let
fixed
while
(
$el
)
{
const
style
=
getComputedStyle
(
$el
)
const
transform
=
style
.
transform
||
style
.
webkitTransform
fixed
=
transform
&&
transform
!==
'
none
'
?
false
:
fixed
fixed
=
style
.
position
===
'
fixed
'
?
true
:
fixed
$el
=
$el
.
parentElement
}
return
fixed
}
export
default
{
name
:
'
Native
'
,
data
()
{
...
...
@@ -28,10 +57,13 @@ export default {
const
rect
=
(
this
.
$refs
.
container
||
this
.
$el
).
getBoundingClientRect
()
this
.
hidden
=
rect
.
width
===
0
||
rect
.
height
===
0
if
(
!
this
.
hidden
)
{
[
'
top
'
,
'
left
'
,
'
width
'
,
'
height
'
].
forEach
(
key
=>
{
const
position
=
this
.
position
position
.
position
=
getFixed
(
this
.
$el
)
?
'
absolute
'
:
'
static
'
const
keys
=
[
'
top
'
,
'
left
'
,
'
width
'
,
'
height
'
]
keys
.
forEach
(
key
=>
{
let
val
=
rect
[
key
]
val
=
key
===
'
top
'
?
val
+
(
document
.
documentElement
.
scrollTop
||
document
.
body
.
scrollTop
||
0
)
:
val
this
.
position
[
key
]
=
val
+
'
px
'
val
=
key
===
'
top
'
?
val
+
(
position
.
position
===
'
static
'
?
(
document
.
documentElement
.
scrollTop
||
document
.
body
.
scrollTop
||
0
)
:
getNavigationBarHeight
()
)
:
val
position
[
key
]
=
val
+
'
px
'
})
}
},
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录