Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MuGuiLin
uni-app
提交
29cc702c
U
uni-app
项目概览
MuGuiLin
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
29cc702c
编写于
7月 16, 2021
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(app): add __VUE_PROD_DEVTOOLS__
上级
b182de45
变更
10
显示空白变更内容
内联
并排
Showing
10 changed file
with
38 addition
and
31 deletion
+38
-31
packages/shims-vue-runtime.d.ts
packages/shims-vue-runtime.d.ts
+0
-1
packages/uni-app-plus/dist/uni-app-service.es.js
packages/uni-app-plus/dist/uni-app-service.es.js
+6
-1
packages/uni-app-plus/dist/uni-app-view.umd.js
packages/uni-app-plus/dist/uni-app-view.umd.js
+1
-1
packages/uni-app-plus/src/service/framework/page/define.ts
packages/uni-app-plus/src/service/framework/page/define.ts
+1
-0
packages/uni-components/src/helpers/useScopedAttrs.ts
packages/uni-components/src/helpers/useScopedAttrs.ts
+5
-7
packages/uni-core/src/service/init/index.ts
packages/uni-core/src/service/init/index.ts
+5
-1
packages/uni-h5/dist/uni-h5.cjs.js
packages/uni-h5/dist/uni-h5.cjs.js
+9
-7
packages/uni-h5/dist/uni-h5.es.js
packages/uni-h5/dist/uni-h5.es.js
+10
-8
packages/uni-h5/src/framework/setup/index.ts
packages/uni-h5/src/framework/setup/index.ts
+0
-5
packages/vite-plugin-uni/src/config/define.ts
packages/vite-plugin-uni/src/config/define.ts
+1
-0
未找到文件。
packages/shims-vue-runtime.d.ts
浏览文件 @
29cc702c
...
...
@@ -22,7 +22,6 @@ declare module '@vue/runtime-core' {
__isUnload
:
boolean
__isVisible
:
boolean
__isActive
?:
boolean
// tabBar
__isPage
:
boolean
}
export
const
callSyncHook
:
(
...
...
packages/uni-app-plus/dist/uni-app-service.es.js
浏览文件 @
29cc702c
...
...
@@ -1808,7 +1808,11 @@ var serviceContext = (function (vue) {
pageVm.$vm = pageVm;
pageVm.$page = page;
pageVm.$mpType = 'page';
pageVm.__isTabBar = page.meta.isTabBar;
if (page.meta.isTabBar) {
pageVm.__isTabBar = true;
// TODO preload? 初始化时,状态肯定是激活
pageVm.$.__isActive = true;
}
}
function querySelector(vm, selector) {
...
...
@@ -9544,6 +9548,7 @@ var serviceContext = (function (vue) {
}
function createPage(__pageId, __pagePath, __pageQuery, __pageInstance, pageOptions) {
const pageNode = createPageNode(__pageId, pageOptions, true);
// TODO 需要同步 main.js 中开发者设置的plugin,mixin,config等
const app = vue.createApp(pagesMap.get(__pagePath)(), {
__pageId,
__pagePath,
...
...
packages/uni-app-plus/dist/uni-app-view.umd.js
浏览文件 @
29cc702c
...
...
@@ -8968,7 +8968,7 @@
if (scopeId) {
state.attrs[scopeId] = "";
}
instance = instance.
__isPage
? null : instance.parent;
instance = instance.
proxy && instance.proxy.$mpType === "page"
? null : instance.parent;
}
});
return {
...
...
packages/uni-app-plus/src/service/framework/page/define.ts
浏览文件 @
29cc702c
...
...
@@ -27,6 +27,7 @@ export function createPage(
pageOptions
:
PageNodeOptions
)
{
const
pageNode
=
createPageNode
(
__pageId
,
pageOptions
,
true
)
// TODO 需要同步 main.js 中开发者设置的plugin,mixin,config等
const
app
=
createApp
(
pagesMap
.
get
(
__pagePath
)
!
(),
{
__pageId
,
__pagePath
,
...
...
packages/uni-components/src/helpers/useScopedAttrs.ts
浏览文件 @
29cc702c
import
{
onMounted
,
getCurrentInstance
,
ComponentInternalInstance
,
reactive
,
}
from
'
vue
'
import
{
onMounted
,
getCurrentInstance
,
reactive
}
from
'
vue
'
interface
State
{
attrs
:
Record
<
string
,
string
>
...
...
@@ -20,7 +15,10 @@ export function useScopedAttrs() {
if
(
scopeId
)
{
state
.
attrs
[
scopeId
]
=
''
}
instance
=
instance
.
__isPage
?
null
:
instance
.
parent
instance
=
instance
.
proxy
&&
instance
.
proxy
.
$mpType
===
'
page
'
?
null
:
instance
.
parent
}
})
...
...
packages/uni-core/src/service/init/index.ts
浏览文件 @
29cc702c
...
...
@@ -23,5 +23,9 @@ export function initPageVm(
pageVm
.
$vm
=
pageVm
pageVm
.
$page
=
page
pageVm
.
$mpType
=
'
page
'
pageVm
.
__isTabBar
=
page
.
meta
.
isTabBar
!
if
(
page
.
meta
.
isTabBar
)
{
pageVm
.
__isTabBar
=
true
// TODO preload? 初始化时,状态肯定是激活
pageVm
.
$
.
__isActive
=
true
}
}
packages/uni-h5/dist/uni-h5.cjs.js
浏览文件 @
29cc702c
...
...
@@ -612,7 +612,10 @@ function initPageVm(pageVm, page) {
pageVm
.
$vm
=
pageVm
;
pageVm
.
$page
=
page
;
pageVm
.
$mpType
=
"
page
"
;
pageVm
.
__isTabBar
=
page
.
meta
.
isTabBar
;
if
(
page
.
meta
.
isTabBar
)
{
pageVm
.
__isTabBar
=
true
;
pageVm
.
$
.
__isActive
=
true
;
}
}
function
converPx
(
value
)
{
if
(
/^-
?\d
+
[
ur
]
px$/i
.
test
(
value
))
{
...
...
@@ -1331,8 +1334,11 @@ function beforeInvokeApi(name, args, protocol, options) {
}
}
function
normalizeErrMsg
(
errMsg
)
{
if
(
errMsg
instanceof
Error
)
{
console
.
error
(
errMsg
);
if
(
shared
.
isString
(
errMsg
))
{
return
errMsg
;
}
if
(
errMsg
.
stack
)
{
console
.
error
(
errMsg
.
message
+
"
\n
"
+
errMsg
.
stack
);
return
errMsg
.
message
;
}
return
errMsg
;
...
...
@@ -6829,12 +6835,8 @@ function setupPage(comp) {
return
setupComponent
(
comp
,
{
init
:
initPage
,
setup
(
instance
)
{
instance
.
__isPage
=
true
;
instance
.
root
=
instance
;
const
route
=
usePageRoute
();
if
(
route
.
meta
.
isTabBar
)
{
instance
.
__isActive
=
true
;
}
{
return
route
.
query
;
}
...
...
packages/uni-h5/dist/uni-h5.es.js
浏览文件 @
29cc702c
...
...
@@ -1382,7 +1382,10 @@ function initPageVm(pageVm, page) {
pageVm.$vm = pageVm;
pageVm.$page = page;
pageVm.$mpType = "page";
pageVm.__isTabBar = page.meta.isTabBar;
if (page.meta.isTabBar) {
pageVm.__isTabBar = true;
pageVm.$.__isActive = true;
}
}
function querySelector(vm, selector) {
const el = vm.$el.querySelector(selector);
...
...
@@ -2492,8 +2495,11 @@ function wrapperOffApi(name, fn, options) {
};
}
function normalizeErrMsg(errMsg) {
if (errMsg instanceof Error) {
console.error(errMsg);
if (isString(errMsg)) {
return errMsg;
}
if (errMsg.stack) {
console.error(errMsg.message + "\n" + errMsg.stack);
return errMsg.message;
}
return errMsg;
...
...
@@ -7860,7 +7866,7 @@ function useScopedAttrs() {
if (scopeId) {
state2.attrs[scopeId] = "";
}
instance2 = instance2.
__isPage
? null : instance2.parent;
instance2 = instance2.
proxy && instance2.proxy.$mpType === "page"
? null : instance2.parent;
}
});
return {
...
...
@@ -13496,12 +13502,8 @@ function setupPage(comp) {
return setupComponent(comp, {
init: initPage,
setup(instance2) {
instance2.__isPage = true;
instance2.root = instance2;
const route = usePageRoute();
if (route.meta.isTabBar) {
instance2.__isActive = true;
}
const pageMeta = usePageMeta();
onBeforeMount(() => {
onPageShow(instance2, pageMeta);
...
...
packages/uni-h5/src/framework/setup/index.ts
浏览文件 @
29cc702c
...
...
@@ -53,13 +53,8 @@ export function setupPage(comp: any) {
return
setupComponent
(
comp
,
{
init
:
initPage
,
setup
(
instance
)
{
instance
.
__isPage
=
true
// 标记当前组件是页面
instance
.
root
=
instance
// 组件root指向页面
const
route
=
usePageRoute
()
if
(
route
.
meta
.
isTabBar
)
{
//初始化时,状态肯定是激活
instance
.
__isActive
=
true
}
// node环境不触发Page生命周期
if
(
__NODE_JS__
)
{
return
route
.
query
...
...
packages/vite-plugin-uni/src/config/define.ts
浏览文件 @
29cc702c
...
...
@@ -5,6 +5,7 @@ export function createDefine({
platform
,
}:
VitePluginUniResolvedOptions
):
UserConfig
[
'
define
'
]
{
return
{
__VUE_PROD_DEVTOOLS__
:
false
,
'
process.env.UNI_PLATFORM
'
:
JSON
.
stringify
(
platform
),
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录