Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-app
提交
4fd85293
U
uni-app
项目概览
DCloud
/
uni-app
通知
699
Star
38703
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,体验更适合开发者的 AI 搜索 >>
提交
4fd85293
编写于
7月 14, 2023
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: build
上级
f7f62c76
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
58 addition
and
34 deletion
+58
-34
packages/uni-h5/dist/uni-h5.cjs.js
packages/uni-h5/dist/uni-h5.cjs.js
+28
-16
packages/uni-h5/dist/uni-h5.es.js
packages/uni-h5/dist/uni-h5.es.js
+29
-17
packages/uni-mp-weixin/dist/uni.compiler.js
packages/uni-mp-weixin/dist/uni.compiler.js
+1
-1
未找到文件。
packages/uni-h5/dist/uni-h5.cjs.js
浏览文件 @
4fd85293
...
@@ -11158,6 +11158,20 @@ function parseTheme(pageStyle) {
...
@@ -11158,6 +11158,20 @@ function parseTheme(pageStyle) {
}
}
return
__uniConfig
.
darkmode
?
parsedStyle
:
pageStyle
;
return
__uniConfig
.
darkmode
?
parsedStyle
:
pageStyle
;
}
}
function
useTheme
(
pageStyle
,
onThemeChangeCallback
)
{
const
isReactived
=
vue
.
isReactive
(
pageStyle
);
const
reactivePageStyle
=
isReactived
?
vue
.
reactive
(
parseTheme
(
pageStyle
))
:
parseTheme
(
pageStyle
);
if
(
__uniConfig
.
darkmode
&&
isReactived
)
{
vue
.
watch
(
pageStyle
,
(
value
)
=>
{
const
_pageStyle
=
parseTheme
(
value
);
for
(
const
key
in
_pageStyle
)
{
reactivePageStyle
[
key
]
=
_pageStyle
[
key
];
}
});
}
onThemeChangeCallback
&&
onThemeChange
(
onThemeChangeCallback
);
return
reactivePageStyle
;
}
const
_middleButton
=
{
const
_middleButton
=
{
width
:
"
50px
"
,
width
:
"
50px
"
,
height
:
"
50px
"
,
height
:
"
50px
"
,
...
@@ -11168,16 +11182,7 @@ const TabBar = /* @__PURE__ */ defineSystemComponent({
...
@@ -11168,16 +11182,7 @@ const TabBar = /* @__PURE__ */ defineSystemComponent({
setup
()
{
setup
()
{
const
visibleList
=
vue
.
ref
([]);
const
visibleList
=
vue
.
ref
([]);
const
_tabBar
=
useTabBar
();
const
_tabBar
=
useTabBar
();
const
tabBar2
=
vue
.
reactive
(
parseTheme
(
_tabBar
));
const
tabBar2
=
useTheme
(
_tabBar
,
()
=>
{
useVisibleList
(
tabBar2
,
visibleList
);
useTabBarCssVar
(
tabBar2
);
const
onSwitchTab
=
useSwitchTab
(
vueRouter
.
useRoute
(),
tabBar2
,
visibleList
);
const
{
style
,
borderStyle
,
placeholderStyle
}
=
useTabBarStyle
(
tabBar2
);
onThemeChange
(()
=>
{
const
tabBarStyle
=
parseTheme
(
_tabBar
);
const
tabBarStyle
=
parseTheme
(
_tabBar
);
tabBar2
.
backgroundColor
=
tabBarStyle
.
backgroundColor
;
tabBar2
.
backgroundColor
=
tabBarStyle
.
backgroundColor
;
tabBar2
.
borderStyle
=
tabBarStyle
.
borderStyle
;
tabBar2
.
borderStyle
=
tabBarStyle
.
borderStyle
;
...
@@ -11191,6 +11196,14 @@ const TabBar = /* @__PURE__ */ defineSystemComponent({
...
@@ -11191,6 +11196,14 @@ const TabBar = /* @__PURE__ */ defineSystemComponent({
});
});
}
}
});
});
useVisibleList
(
tabBar2
,
visibleList
);
useTabBarCssVar
(
tabBar2
);
const
onSwitchTab
=
useSwitchTab
(
vueRouter
.
useRoute
(),
tabBar2
,
visibleList
);
const
{
style
,
borderStyle
,
placeholderStyle
}
=
useTabBarStyle
(
tabBar2
);
return
()
=>
{
return
()
=>
{
const
tabBarItemsTsx
=
createTabBarItemsTsx
(
tabBar2
,
onSwitchTab
,
visibleList
);
const
tabBarItemsTsx
=
createTabBarItemsTsx
(
tabBar2
,
onSwitchTab
,
visibleList
);
return
vue
.
createVNode
(
"
uni-tabbar
"
,
{
return
vue
.
createVNode
(
"
uni-tabbar
"
,
{
...
@@ -11824,16 +11837,15 @@ const PageHead = /* @__PURE__ */ defineSystemComponent({
...
@@ -11824,16 +11837,15 @@ const PageHead = /* @__PURE__ */ defineSystemComponent({
setup
()
{
setup
()
{
const
headRef
=
vue
.
ref
(
null
);
const
headRef
=
vue
.
ref
(
null
);
const
pageMeta
=
usePageMeta
();
const
pageMeta
=
usePageMeta
();
const
navigationBar
=
vue
.
reactive
(
parseTheme
(
pageMeta
.
navigationBar
));
const
navigationBar
=
useTheme
(
pageMeta
.
navigationBar
,
()
=>
{
const
{
clazz
:
clazz2
,
style
}
=
usePageHead
(
navigationBar
);
onThemeChange
(()
=>
{
const
_navigationBar
=
parseTheme
(
pageMeta
.
navigationBar
);
const
_navigationBar
=
parseTheme
(
pageMeta
.
navigationBar
);
navigationBar
.
backgroundColor
=
_navigationBar
.
backgroundColor
;
navigationBar
.
backgroundColor
=
_navigationBar
.
backgroundColor
;
navigationBar
.
titleColor
=
_navigationBar
.
titleColor
;
navigationBar
.
titleColor
=
_navigationBar
.
titleColor
;
});
});
const
{
clazz
:
clazz2
,
style
}
=
usePageHead
(
navigationBar
);
const
buttons
=
__UNI_FEATURE_NAVIGATIONBAR_BUTTONS__
&&
usePageHeadButtons
(
pageMeta
);
const
buttons
=
__UNI_FEATURE_NAVIGATIONBAR_BUTTONS__
&&
usePageHeadButtons
(
pageMeta
);
const
searchInput
=
__UNI_FEATURE_NAVIGATIONBAR_SEARCHINPUT__
&&
navigationBar
.
searchInput
&&
usePageHeadSearchInput
(
pageMeta
);
const
searchInput
=
__UNI_FEATURE_NAVIGATIONBAR_SEARCHINPUT__
&&
navigationBar
.
searchInput
&&
usePageHeadSearchInput
(
pageMeta
);
__UNI_FEATURE_NAVIGATIONBAR_TRANSPARENT__
&&
navigationBar
.
type
===
"
transparent
"
&&
usePageHeadTransparent
(
headRef
,
pageMeta
);
__UNI_FEATURE_NAVIGATIONBAR_TRANSPARENT__
&&
navigationBar
.
type
===
"
transparent
"
&&
usePageHeadTransparent
(
headRef
,
pageMeta
);
...
...
packages/uni-h5/dist/uni-h5.es.js
浏览文件 @
4fd85293
import { withModifiers, createVNode, getCurrentInstance, ref, defineComponent, openBlock, createElementBlock, provide, computed, watch, onUnmounted, inject, onBeforeUnmount, mergeProps, injectHook, reactive, onActivated, onMounted, nextTick, onBeforeMount, withDirectives, vModelDynamic, vShow, shallowRef, watchEffect, isVNode, Fragment, markRaw, Comment, h, createTextVNode, createBlock, onBeforeActivate, onBeforeDeactivate, renderList, onDeactivated, createApp, Transition, effectScope, withCtx, KeepAlive, resolveDynamicComponent, createElementVNode, normalizeStyle, renderSlot } from "vue";
import { withModifiers, createVNode, getCurrentInstance, ref, defineComponent, openBlock, createElementBlock, provide, computed, watch, onUnmounted, inject, onBeforeUnmount, mergeProps, injectHook, reactive, onActivated, onMounted, nextTick, onBeforeMount, withDirectives, vModelDynamic, vShow, shallowRef, watchEffect, isVNode, Fragment, markRaw, Comment, h, createTextVNode, createBlock, onBeforeActivate, onBeforeDeactivate, renderList, onDeactivated, createApp,
isReactive,
Transition, effectScope, withCtx, KeepAlive, resolveDynamicComponent, createElementVNode, normalizeStyle, renderSlot } from "vue";
import { isArray, isString, extend, remove, stringifyStyle, parseStringStyle, isPlainObject, isFunction, capitalize, camelize, hasOwn, isObject, toRawType, makeMap as makeMap$1, isPromise, hyphenate, invokeArrayFns as invokeArrayFns$1 } from "@vue/shared";
import { isArray, isString, extend, remove, stringifyStyle, parseStringStyle, isPlainObject, isFunction, capitalize, camelize, hasOwn, isObject, toRawType, makeMap as makeMap$1, isPromise, hyphenate, invokeArrayFns as invokeArrayFns$1 } from "@vue/shared";
import { once, UNI_STORAGE_LOCALE, I18N_JSON_DELIMITERS, Emitter, passive, initCustomDatasetOnce, resolveComponentInstance, normalizeStyles, addLeadingSlash, invokeArrayFns, removeLeadingSlash, resolveOwnerVm, resolveOwnerEl, ON_WXS_INVOKE_CALL_METHOD, normalizeTarget, ON_RESIZE, ON_APP_ENTER_FOREGROUND, ON_APP_ENTER_BACKGROUND, ON_SHOW, ON_HIDE, ON_PAGE_SCROLL, ON_REACH_BOTTOM, EventChannel, SCHEME_RE, DATA_RE, getCustomDataset, LINEFEED, ON_ERROR, callOptions, ON_UNHANDLE_REJECTION, ON_PAGE_NOT_FOUND, PRIMARY_COLOR, getLen, debounce, isUniLifecycleHook, ON_LOAD, UniLifecycleHooks, invokeCreateErrorHandler, invokeCreateVueAppHook, parseQuery, NAVBAR_HEIGHT, ON_UNLOAD, ON_REACH_BOTTOM_DISTANCE, decodedQuery, WEB_INVOKE_APPSERVICE, ON_WEB_INVOKE_APP_SERVICE, ON_THEME_CHANGE, updateElementStyle, sortObject, OFF_THEME_CHANGE, ON_BACK_PRESS, parseUrl, addFont, ON_NAVIGATION_BAR_CHANGE, scrollTo, RESPONSIVE_MIN_WIDTH, onCreateVueApp, formatDateTime, ON_NAVIGATION_BAR_BUTTON_TAP, ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED, ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED, ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED, ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED, ON_PULL_DOWN_REFRESH } from "@dcloudio/uni-shared";
import { once, UNI_STORAGE_LOCALE, I18N_JSON_DELIMITERS, Emitter, passive, initCustomDatasetOnce, resolveComponentInstance, normalizeStyles, addLeadingSlash, invokeArrayFns, removeLeadingSlash, resolveOwnerVm, resolveOwnerEl, ON_WXS_INVOKE_CALL_METHOD, normalizeTarget, ON_RESIZE, ON_APP_ENTER_FOREGROUND, ON_APP_ENTER_BACKGROUND, ON_SHOW, ON_HIDE, ON_PAGE_SCROLL, ON_REACH_BOTTOM, EventChannel, SCHEME_RE, DATA_RE, getCustomDataset, LINEFEED, ON_ERROR, callOptions, ON_UNHANDLE_REJECTION, ON_PAGE_NOT_FOUND, PRIMARY_COLOR, getLen, debounce, isUniLifecycleHook, ON_LOAD, UniLifecycleHooks, invokeCreateErrorHandler, invokeCreateVueAppHook, parseQuery, NAVBAR_HEIGHT, ON_UNLOAD, ON_REACH_BOTTOM_DISTANCE, decodedQuery, WEB_INVOKE_APPSERVICE, ON_WEB_INVOKE_APP_SERVICE, ON_THEME_CHANGE, updateElementStyle, sortObject, OFF_THEME_CHANGE, ON_BACK_PRESS, parseUrl, addFont, ON_NAVIGATION_BAR_CHANGE, scrollTo, RESPONSIVE_MIN_WIDTH, onCreateVueApp, formatDateTime, ON_NAVIGATION_BAR_BUTTON_TAP, ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED, ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED, ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED, ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED, ON_PULL_DOWN_REFRESH } from "@dcloudio/uni-shared";
import { onCreateVueApp as onCreateVueApp2 } from "@dcloudio/uni-shared";
import { onCreateVueApp as onCreateVueApp2 } from "@dcloudio/uni-shared";
...
@@ -20880,6 +20880,20 @@ function parseTheme(pageStyle) {
...
@@ -20880,6 +20880,20 @@ function parseTheme(pageStyle) {
}
}
return __uniConfig.darkmode ? parsedStyle : pageStyle;
return __uniConfig.darkmode ? parsedStyle : pageStyle;
}
}
function useTheme(pageStyle, onThemeChangeCallback) {
const isReactived = isReactive(pageStyle);
const reactivePageStyle = isReactived ? reactive(parseTheme(pageStyle)) : parseTheme(pageStyle);
if (__uniConfig.darkmode && isReactived) {
watch(pageStyle, (value) => {
const _pageStyle = parseTheme(value);
for (const key in _pageStyle) {
reactivePageStyle[key] = _pageStyle[key];
}
});
}
onThemeChangeCallback && onThemeChange(onThemeChangeCallback);
return reactivePageStyle;
}
const ModalTheme = {
const ModalTheme = {
light: {
light: {
cancelColor: "#000000"
cancelColor: "#000000"
...
@@ -21910,16 +21924,7 @@ const TabBar = /* @__PURE__ */ defineSystemComponent({
...
@@ -21910,16 +21924,7 @@ const TabBar = /* @__PURE__ */ defineSystemComponent({
setup() {
setup() {
const visibleList = ref([]);
const visibleList = ref([]);
const _tabBar = useTabBar();
const _tabBar = useTabBar();
const tabBar2 = reactive(parseTheme(_tabBar));
const tabBar2 = useTheme(_tabBar, () => {
useVisibleList(tabBar2, visibleList);
useTabBarCssVar(tabBar2);
const onSwitchTab = useSwitchTab(useRoute(), tabBar2, visibleList);
const {
style,
borderStyle,
placeholderStyle
} = useTabBarStyle(tabBar2);
onThemeChange(() => {
const tabBarStyle = parseTheme(_tabBar);
const tabBarStyle = parseTheme(_tabBar);
tabBar2.backgroundColor = tabBarStyle.backgroundColor;
tabBar2.backgroundColor = tabBarStyle.backgroundColor;
tabBar2.borderStyle = tabBarStyle.borderStyle;
tabBar2.borderStyle = tabBarStyle.borderStyle;
...
@@ -21933,6 +21938,14 @@ const TabBar = /* @__PURE__ */ defineSystemComponent({
...
@@ -21933,6 +21938,14 @@ const TabBar = /* @__PURE__ */ defineSystemComponent({
});
});
}
}
});
});
useVisibleList(tabBar2, visibleList);
useTabBarCssVar(tabBar2);
const onSwitchTab = useSwitchTab(useRoute(), tabBar2, visibleList);
const {
style,
borderStyle,
placeholderStyle
} = useTabBarStyle(tabBar2);
onMounted(() => {
onMounted(() => {
if (tabBar2.iconfontSrc) {
if (tabBar2.iconfontSrc) {
loadFontFace({
loadFontFace({
...
@@ -24514,16 +24527,15 @@ const PageHead = /* @__PURE__ */ defineSystemComponent({
...
@@ -24514,16 +24527,15 @@ const PageHead = /* @__PURE__ */ defineSystemComponent({
setup() {
setup() {
const headRef = ref(null);
const headRef = ref(null);
const pageMeta = usePageMeta();
const pageMeta = usePageMeta();
const navigationBar = reactive(parseTheme(pageMeta.navigationBar));
const navigationBar = useTheme(pageMeta.navigationBar, () => {
const {
clazz: clazz2,
style
} = usePageHead(navigationBar);
onThemeChange(() => {
const _navigationBar = parseTheme(pageMeta.navigationBar);
const _navigationBar = parseTheme(pageMeta.navigationBar);
navigationBar.backgroundColor = _navigationBar.backgroundColor;
navigationBar.backgroundColor = _navigationBar.backgroundColor;
navigationBar.titleColor = _navigationBar.titleColor;
navigationBar.titleColor = _navigationBar.titleColor;
});
});
const {
clazz: clazz2,
style
} = usePageHead(navigationBar);
const buttons = __UNI_FEATURE_NAVIGATIONBAR_BUTTONS__ && usePageHeadButtons(pageMeta);
const buttons = __UNI_FEATURE_NAVIGATIONBAR_BUTTONS__ && usePageHeadButtons(pageMeta);
const searchInput = __UNI_FEATURE_NAVIGATIONBAR_SEARCHINPUT__ && navigationBar.searchInput && usePageHeadSearchInput(pageMeta);
const searchInput = __UNI_FEATURE_NAVIGATIONBAR_SEARCHINPUT__ && navigationBar.searchInput && usePageHeadSearchInput(pageMeta);
__UNI_FEATURE_NAVIGATIONBAR_TRANSPARENT__ && navigationBar.type === "transparent" && usePageHeadTransparent(headRef, pageMeta);
__UNI_FEATURE_NAVIGATIONBAR_TRANSPARENT__ && navigationBar.type === "transparent" && usePageHeadTransparent(headRef, pageMeta);
...
...
packages/uni-mp-weixin/dist/uni.compiler.js
浏览文件 @
4fd85293
...
@@ -16,7 +16,7 @@ var uniad_app_json = function (appJson) {
...
@@ -16,7 +16,7 @@ var uniad_app_json = function (appJson) {
}
}
if
(
!
appJson
.
plugins
[
'
uni-ad
'
])
{
if
(
!
appJson
.
plugins
[
'
uni-ad
'
])
{
appJson
.
plugins
[
'
uni-ad
'
]
=
{
appJson
.
plugins
[
'
uni-ad
'
]
=
{
version
:
'
1.1.
7
'
,
version
:
'
1.1.
10
'
,
provider
:
'
wxf72d316417b6767f
'
,
provider
:
'
wxf72d316417b6767f
'
,
};
};
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录