Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-app
提交
c40b9e42
U
uni-app
项目概览
DCloud
/
uni-app
2 个月 前同步成功
通知
716
Star
38705
Fork
3642
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
7
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
7
Issue
7
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c40b9e42
编写于
10月 11, 2019
作者:
fxy060608
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' of
https://github.com/dcloudio/uni-app
into v3
# Conflicts: # packages/vue-cli-plugin-uni/lib/env.js
上级
29f21749
5aaf715c
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
46 addition
and
32 deletion
+46
-32
packages/vue-cli-plugin-uni/lib/app-plus/index.js
packages/vue-cli-plugin-uni/lib/app-plus/index.js
+4
-5
packages/vue-cli-plugin-uni/lib/env.js
packages/vue-cli-plugin-uni/lib/env.js
+11
-8
packages/webpack-uni-pages-loader/lib/platforms/app-plus/index.js
.../webpack-uni-pages-loader/lib/platforms/app-plus/index.js
+12
-13
src/platforms/app-plus-nvue/services/api/sub-nvue.js
src/platforms/app-plus-nvue/services/api/sub-nvue.js
+9
-3
src/platforms/app-plus/runtime/api/sub-nvue.js
src/platforms/app-plus/runtime/api/sub-nvue.js
+10
-3
未找到文件。
packages/vue-cli-plugin-uni/lib/app-plus/index.js
浏览文件 @
c40b9e42
...
...
@@ -10,7 +10,7 @@ const {
isUnaryTag
}
=
require
(
'
../util
'
)
function
getProvides
()
{
function
getProvides
()
{
return
{
'
__f__
'
:
[
path
.
resolve
(
__dirname
,
'
../format-log.js
'
),
'
default
'
]
}
...
...
@@ -20,7 +20,7 @@ const v3 = {
vueConfig
:
{
parallel
:
false
},
webpackConfig
(
webpackConfig
,
vueOptions
)
{
webpackConfig
(
webpackConfig
,
vueOptions
)
{
const
isAppService
=
!!
vueOptions
.
pluginOptions
[
'
uni-app-plus
'
][
'
service
'
]
const
isAppView
=
!!
vueOptions
.
pluginOptions
[
'
uni-app-plus
'
][
'
view
'
]
...
...
@@ -34,7 +34,6 @@ const v3 = {
// disable noEmitOnErrors
webpackConfig
.
optimization
.
noEmitOnErrors
=
false
if
(
isAppService
)
{
webpackConfig
.
optimization
.
runtimeChunk
=
{
name
:
'
app-config
'
...
...
@@ -53,7 +52,7 @@ const v3 = {
externals
:
{
vue
:
'
Vue
'
},
entry
()
{
entry
()
{
const
entry
=
{}
if
(
isAppService
)
{
entry
[
'
app-service
'
]
=
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
getMainEntry
())
...
...
@@ -96,7 +95,7 @@ const v3 = {
]
}
},
chainWebpack
(
webpackConfig
,
vueOptions
)
{
chainWebpack
(
webpackConfig
,
vueOptions
)
{
const
isAppService
=
!!
vueOptions
.
pluginOptions
[
'
uni-app-plus
'
][
'
service
'
]
const
isAppView
=
!!
vueOptions
.
pluginOptions
[
'
uni-app-plus
'
][
'
view
'
]
...
...
packages/vue-cli-plugin-uni/lib/env.js
浏览文件 @
c40b9e42
...
...
@@ -184,13 +184,16 @@ if (process.env.UNI_USING_COMPONENTS) { // 是否启用分包优化
}
const
warningMsg
=
usingComponentsAbsent
?
`该应用之前可能是非自定义组件模式,目前以自定义组件模式运行。非自定义组件将于2019年11月1日起停止支持。详见:https://ask.dcloud.net.cn/article/36385`
:
`uni-app将于2019年11月1日起停止支持非自定义组件模式 [详情](https://ask.dcloud.net.cn/article/36385)`
usingComponentsAbsent
?
`该应用之前可能是非自定义组件模式,目前以自定义组件模式运行。非自定义组件将于2019年11月1日起停止支持。详见:https://ask.dcloud.net.cn/article/36385`
:
`uni-app将于2019年11月1日起停止支持非自定义组件模式 [详情](https://ask.dcloud.net.cn/article/36385)`
const
needWarning
=
!
platformOptions
.
usingComponents
||
usingComponentsAbsent
// 输出编译器版本等信息
if
(
process
.
env
.
UNI_PLATFORM
!==
'
h5
'
)
{
if
(
process
.
env
.
UNI_USING_NATIVE
)
{
console
.
log
(
'
当前nvue编译模式:
'
+
(
isNVueCompiler
?
'
uni-app
'
:
'
weex
'
)
+
'
。编译模式差异见:https://ask.dcloud.net.cn/article/36074
'
)
}
else
if
(
process
.
env
.
UNI_PLATFORM
!==
'
h5
'
)
{
try
{
const
modeText
=
'
当前项目编译模式:
'
+
(
platformOptions
.
usingComponents
?
'
自定义组件模式
'
:
'
非自定义组件模式
'
)
+
...
...
@@ -204,8 +207,8 @@ if (process.env.UNI_PLATFORM !== 'h5') {
}
const
glob
=
require
(
'
glob
'
)
if
(
glob
.
sync
(
'
pages/**/*.nvue
'
,
{
cwd
:
process
.
env
.
UNI_INPUT_DIR
}).
length
)
{
cwd
:
process
.
env
.
UNI_INPUT_DIR
}).
length
)
{
console
.
log
(
info
)
console
.
log
(
modeText
)
if
(
needWarning
)
{
...
...
@@ -237,9 +240,9 @@ moduleAlias.addAlias('mpvue-template-compiler', '@dcloudio/vue-cli-plugin-uni/pa
if
(
runByHBuilderX
)
{
const
oldError
=
console
.
error
console
.
error
=
function
(
msg
)
{
console
.
error
=
function
(
msg
)
{
if
(
typeof
msg
===
'
string
'
&&
msg
.
includes
(
'
[BABEL] Note: The code generator has deoptimised the styling of
'
))
{
'
[BABEL] Note: The code generator has deoptimised the styling of
'
))
{
const
filePath
=
msg
.
replace
(
'
[BABEL] Note: The code generator has deoptimised the styling of
'
,
''
).
split
(
'
as
'
)[
0
]
console
.
log
(
'
[警告] `
'
+
path
.
relative
(
process
.
env
.
UNI_INPUT_DIR
,
filePath
)
+
...
...
packages/webpack-uni-pages-loader/lib/platforms/app-plus/index.js
浏览文件 @
c40b9e42
...
...
@@ -15,7 +15,7 @@ const {
const
parseV3Config
=
require
(
'
./config-parser
'
)
function
parseConfig
(
appJson
)
{
function
parseConfig
(
appJson
)
{
return
{
name
:
'
app-config.js
'
,
content
:
`__registerConfig(
${
JSON
.
stringify
(
appJson
)}
);`
...
...
@@ -24,11 +24,11 @@ function parseConfig(appJson) {
const
_toString
=
Object
.
prototype
.
toString
function
isPlainObject
(
obj
)
{
function
isPlainObject
(
obj
)
{
return
_toString
.
call
(
obj
)
===
'
[object Object]
'
}
function
normalizeNetworkTimeout
(
appJson
)
{
function
normalizeNetworkTimeout
(
appJson
)
{
if
(
!
isPlainObject
(
appJson
.
networkTimeout
))
{
appJson
.
networkTimeout
=
{
request
:
6000
,
...
...
@@ -52,7 +52,7 @@ function normalizeNetworkTimeout(appJson) {
}
}
module
.
exports
=
function
(
pagesJson
,
userManifestJson
)
{
module
.
exports
=
function
(
pagesJson
,
userManifestJson
)
{
const
{
app
}
=
require
(
'
../mp
'
)(
pagesJson
,
userManifestJson
)
...
...
@@ -65,9 +65,9 @@ module.exports = function(pagesJson, userManifestJson) {
const
{
navigationBarTextStyle
=
'
white
'
,
navigationBarBackgroundColor
=
'
#000000
'
navigationBarBackgroundColor
=
'
#000000
'
}
=
appJson
[
'
window
'
]
||
{}
const
TABBAR_HEIGHT
=
50
let
manifestJson
=
JSON
.
parse
(
fs
.
readFileSync
(
path
.
resolve
(
__dirname
,
'
./manifest.json
'
),
'
utf8
'
))
...
...
@@ -182,7 +182,7 @@ module.exports = function(pagesJson, userManifestJson) {
// 允许内联播放视频
manifestJson
.
plus
.
allowsInlineMediaPlayback
=
true
const
addRenderAlways
=
function
()
{
const
addRenderAlways
=
function
()
{
// "render": "always"
if
(
!
manifestJson
.
plus
.
launchwebview
)
{
manifestJson
.
plus
.
launchwebview
=
{
...
...
@@ -382,7 +382,7 @@ module.exports = function(pagesJson, userManifestJson) {
})
delete
appJson
.
nvue
delete
manifestJson
.
plus
.
launchwebview
.
kernel
manifestJson
.
launch_path
=
''
Object
.
assign
(
manifestJson
.
plus
.
launchwebview
,
{
...
...
@@ -437,21 +437,20 @@ module.exports = function(pagesJson, userManifestJson) {
manifest
.
content
=
JSON
.
stringify
(
manifest
.
content
)
return
[
manifest
,
parseConfig
(
appJson
)]
}
if
(
process
.
env
.
UNI_USING_V3
)
{
if
(
process
.
env
.
UNI_USING_V3
)
{
appJson
.
entryPagePath
=
appJson
.
pages
[
0
]
appJson
.
page
=
Object
.
create
(
null
)
const
addPage
=
function
(
pagePath
,
windowOptions
)
{
const
addPage
=
function
(
pagePath
,
windowOptions
)
{
delete
windowOptions
.
usingComponents
appJson
.
page
[
pagePath
]
=
{
window
:
windowOptions
}
}
parsePages
(
pagesJson
,
function
(
page
)
{
parsePages
(
pagesJson
,
function
(
page
)
{
addPage
(
page
.
path
,
parseStyle
(
page
.
style
))
},
function
(
root
,
page
)
{
},
function
(
root
,
page
)
{
addPage
(
normalizePath
(
path
.
join
(
root
,
page
.
path
)),
parseStyle
(
page
.
style
,
root
))
})
manifest
.
name
=
'
manifest.json
'
...
...
src/platforms/app-plus-nvue/services/api/sub-nvue.js
浏览文件 @
c40b9e42
...
...
@@ -71,8 +71,14 @@ export function initSubNVue (nvue, plus, BroadcastChannel) {
const
maskColor
=
webview
.
__uniapp_mask
let
maskWebview
=
plus
.
webview
.
getWebviewById
(
webview
.
__uniapp_mask_id
)
maskWebview
=
maskWebview
.
parent
()
||
maskWebview
// 再次检测父
let
maskWebview
=
webview
.
__uniapp_mask_id
===
'
0
'
?
{
setStyle
({
mask
})
{
nvue
.
requireModule
(
'
uni-tabview
'
).
setMask
({
color
:
mask
})
}
}
:
plus
.
webview
.
getWebviewById
(
webview
.
__uniapp_mask_id
)
const
oldShow
=
webview
.
show
const
oldHide
=
webview
.
hide
const
oldClose
=
webview
.
close
...
...
@@ -115,4 +121,4 @@ export function initSubNVue (nvue, plus, BroadcastChannel) {
return
getSubNVueById
(
plus
.
webview
.
currentWebview
().
id
)
}
}
}
}
src/platforms/app-plus/runtime/api/sub-nvue.js
浏览文件 @
c40b9e42
import
{
requireNativePlugin
}
from
'
./index
'
function
wrapper
(
webview
)
{
webview
.
$processed
=
true
...
...
@@ -19,8 +21,13 @@ function wrapper (webview) {
return
}
const
maskColor
=
webview
.
__uniapp_mask
let
maskWebview
=
plus
.
webview
.
getWebviewById
(
webview
.
__uniapp_mask_id
)
maskWebview
=
maskWebview
.
parent
()
||
maskWebview
// 再次检测父
let
maskWebview
=
webview
.
__uniapp_mask_id
===
'
0
'
?
{
setStyle
({
mask
})
{
requireNativePlugin
(
'
uni-tabview
'
).
setMask
({
color
:
mask
})
}
}
:
plus
.
webview
.
getWebviewById
(
webview
.
__uniapp_mask_id
)
const
oldShow
=
webview
.
show
const
oldHide
=
webview
.
hide
const
oldClose
=
webview
.
close
...
...
@@ -56,4 +63,4 @@ export function getSubNVueById (id) {
wrapper
(
webview
)
}
return
webview
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录