Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yangkaifeng
uni-app
提交
6ac07c8a
U
uni-app
项目概览
yangkaifeng
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
3
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,发现更多精彩内容 >>
提交
6ac07c8a
编写于
11月 03, 2021
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(api): add setPageMeta
上级
4bb3034c
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
96 addition
and
14 deletion
+96
-14
packages/uni-api/src/index.ts
packages/uni-api/src/index.ts
+1
-0
packages/uni-api/src/service/ui/setPageMeta.ts
packages/uni-api/src/service/ui/setPageMeta.ts
+20
-0
packages/uni-app-plus/dist/uni-app-service.es.js
packages/uni-app-plus/dist/uni-app-service.es.js
+12
-2
packages/uni-app-plus/dist/uni-app-view.umd.js
packages/uni-app-plus/dist/uni-app-view.umd.js
+3
-3
packages/uni-app-plus/src/platform/index.ts
packages/uni-app-plus/src/platform/index.ts
+1
-0
packages/uni-app-plus/src/service/api/index.ts
packages/uni-app-plus/src/service/api/index.ts
+1
-0
packages/uni-app-plus/src/service/api/ui/navigationBar.ts
packages/uni-app-plus/src/service/api/ui/navigationBar.ts
+2
-2
packages/uni-app-plus/src/service/api/ui/setPageMeta.ts
packages/uni-app-plus/src/service/api/ui/setPageMeta.ts
+9
-0
packages/uni-app-plus/src/view/framework/viewMethods.ts
packages/uni-app-plus/src/view/framework/viewMethods.ts
+7
-2
packages/uni-h5-vite/lib/api.json
packages/uni-h5-vite/lib/api.json
+1
-0
packages/uni-h5/dist/uni-h5.es.js
packages/uni-h5/dist/uni-h5.es.js
+17
-3
packages/uni-h5/src/platform/index.ts
packages/uni-h5/src/platform/index.ts
+1
-0
packages/uni-h5/src/service/api/index.ts
packages/uni-h5/src/service/api/index.ts
+1
-0
packages/uni-h5/src/service/api/ui/navigationBar.ts
packages/uni-h5/src/service/api/ui/navigationBar.ts
+2
-2
packages/uni-h5/src/service/api/ui/setPageMeta.ts
packages/uni-h5/src/service/api/ui/setPageMeta.ts
+18
-0
未找到文件。
packages/uni-api/src/index.ts
浏览文件 @
6ac07c8a
...
@@ -15,6 +15,7 @@ export * from './service/ui/createAnimation'
...
@@ -15,6 +15,7 @@ export * from './service/ui/createAnimation'
export
*
from
'
./service/ui/tabBar
'
export
*
from
'
./service/ui/tabBar
'
export
*
from
'
./service/ui/window
'
export
*
from
'
./service/ui/window
'
export
*
from
'
./service/ui/locale
'
export
*
from
'
./service/ui/locale
'
export
*
from
'
./service/ui/setPageMeta
'
export
*
from
'
./service/keyboard/getSelectedTextRange
'
export
*
from
'
./service/keyboard/getSelectedTextRange
'
...
...
packages/uni-api/src/service/ui/setPageMeta.ts
0 → 100644
浏览文件 @
6ac07c8a
import
{
defineAsyncApi
}
from
'
../../helpers/api
'
import
{
getCurrentPageVm
}
from
'
@dcloudio/uni-core
'
import
{
setCurrentPageMeta
}
from
'
@dcloudio/uni-platform
'
export
interface
SetPageMetaOptions
{
pageStyle
?:
string
rootFontSize
?:
string
success
?:
(
result
:
any
)
=>
void
fail
?:
(
result
:
any
)
=>
void
complete
?:
(
result
:
any
)
=>
void
}
type
API_TYPE_SET_PAGE_META
=
(
options
:
SetPageMetaOptions
)
=>
void
export
const
API_SET_PAGE_META
=
'
setPageMeta
'
export
const
setPageMeta
=
defineAsyncApi
<
API_TYPE_SET_PAGE_META
>
(
API_SET_PAGE_META
,
(
options
,
{
resolve
})
=>
{
resolve
(
setCurrentPageMeta
(
getCurrentPageVm
()
!
,
options
))
}
)
packages/uni-app-plus/dist/uni-app-service.es.js
浏览文件 @
6ac07c8a
...
@@ -1272,6 +1272,10 @@ var serviceContext = (function (vue) {
...
@@ -1272,6 +1272,10 @@ var serviceContext = (function (vue) {
}, page.$page.id, callback);
}, page.$page.id, callback);
}
}
function setCurrentPageMeta(page, options) {
UniServiceJSBridge.invokeViewMethod('setPageMeta', options, page.$page.id);
}
const isArray = Array.isArray;
const isArray = Array.isArray;
const isObject = (val) => val !== null && typeof val === 'object';
const isObject = (val) => val !== null && typeof val === 'object';
const defaultDelimiters = ['{', '}'];
const defaultDelimiters = ['{', '}'];
...
@@ -4471,6 +4475,11 @@ var serviceContext = (function (vue) {
...
@@ -4471,6 +4475,11 @@ var serviceContext = (function (vue) {
return false;
return false;
});
});
const API_SET_PAGE_META = 'setPageMeta';
const setPageMeta = defineAsyncApi(API_SET_PAGE_META, (options, { resolve }) => {
resolve(setCurrentPageMeta(getCurrentPageVm(), options));
});
const API_GET_SELECTED_TEXT_RANGE = 'getSelectedTextRange';
const API_GET_SELECTED_TEXT_RANGE = 'getSelectedTextRange';
const getSelectedTextRange = defineAsyncApi(API_GET_SELECTED_TEXT_RANGE, (_, { resolve, reject }) => {
const getSelectedTextRange = defineAsyncApi(API_GET_SELECTED_TEXT_RANGE, (_, { resolve, reject }) => {
...
@@ -9349,7 +9358,7 @@ var serviceContext = (function (vue) {
...
@@ -9349,7 +9358,7 @@ var serviceContext = (function (vue) {
plus.nativeUI.closeWaiting();
plus.nativeUI.closeWaiting();
resolve();
resolve();
});
});
function setPage
Meta
(statusBarStyle) {
function setPage
StatusBarStyle
(statusBarStyle) {
const pages = getCurrentPages();
const pages = getCurrentPages();
if (!pages.length) {
if (!pages.length) {
return;
return;
...
@@ -9370,7 +9379,7 @@ var serviceContext = (function (vue) {
...
@@ -9370,7 +9379,7 @@ var serviceContext = (function (vue) {
const statusBarStyle = frontColor === '#000000' ? 'dark' : 'light';
const statusBarStyle = frontColor === '#000000' ? 'dark' : 'light';
plus.navigator.setStatusBarStyle(statusBarStyle);
plus.navigator.setStatusBarStyle(statusBarStyle);
// 用户调用api时同时改变当前页配置,这样在系统调用设置时,可以避免覆盖用户设置
// 用户调用api时同时改变当前页配置,这样在系统调用设置时,可以避免覆盖用户设置
setPage
Meta
(statusBarStyle);
setPage
StatusBarStyle
(statusBarStyle);
const style = webview.getStyle();
const style = webview.getStyle();
if (style && style.titleNView) {
if (style && style.titleNView) {
if (style.titleNView.autoBackButton) {
if (style.titleNView.autoBackButton) {
...
@@ -12752,6 +12761,7 @@ var serviceContext = (function (vue) {
...
@@ -12752,6 +12761,7 @@ var serviceContext = (function (vue) {
$emit: $emit,
$emit: $emit,
onAppLaunch: onAppLaunch,
onAppLaunch: onAppLaunch,
onLocaleChange: onLocaleChange,
onLocaleChange: onLocaleChange,
setPageMeta: setPageMeta,
setStorageSync: setStorageSync,
setStorageSync: setStorageSync,
setStorage: setStorage,
setStorage: setStorage,
getStorageSync: getStorageSync,
getStorageSync: getStorageSync,
...
...
packages/uni-app-plus/dist/uni-app-view.umd.js
浏览文件 @
6ac07c8a
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
packages/uni-app-plus/src/platform/index.ts
浏览文件 @
6ac07c8a
export
{
getBaseSystemInfo
}
from
'
../service/api/base/getBaseSystemInfo
'
export
{
getBaseSystemInfo
}
from
'
../service/api/base/getBaseSystemInfo
'
export
{
requestComponentInfo
}
from
'
../service/api/ui/requestComponentInfo
'
export
{
requestComponentInfo
}
from
'
../service/api/ui/requestComponentInfo
'
export
{
setCurrentPageMeta
}
from
'
../service/api/ui/setPageMeta
'
export
{
getRealPath
}
from
'
./getRealPath
'
export
{
getRealPath
}
from
'
./getRealPath
'
export
{
operateVideoPlayer
}
from
'
../service/api/context/operateVideoPlayer
'
export
{
operateVideoPlayer
}
from
'
../service/api/context/operateVideoPlayer
'
export
{
operateMap
}
from
'
../service/api/context/operateMap
'
export
{
operateMap
}
from
'
../service/api/context/operateMap
'
...
...
packages/uni-app-plus/src/service/api/index.ts
浏览文件 @
6ac07c8a
...
@@ -105,4 +105,5 @@ export {
...
@@ -105,4 +105,5 @@ export {
$emit
,
$emit
,
onAppLaunch
,
onAppLaunch
,
onLocaleChange
,
onLocaleChange
,
setPageMeta
,
}
from
'
@dcloudio/uni-api
'
}
from
'
@dcloudio/uni-api
'
packages/uni-app-plus/src/service/api/ui/navigationBar.ts
浏览文件 @
6ac07c8a
...
@@ -66,7 +66,7 @@ export const hideNavigationBarLoading =
...
@@ -66,7 +66,7 @@ export const hideNavigationBarLoading =
}
}
)
)
function
setPage
Meta
(
statusBarStyle
:
StatusBarStyle
)
{
function
setPage
StatusBarStyle
(
statusBarStyle
:
StatusBarStyle
)
{
const
pages
=
getCurrentPages
()
const
pages
=
getCurrentPages
()
if
(
!
pages
.
length
)
{
if
(
!
pages
.
length
)
{
return
return
...
@@ -100,7 +100,7 @@ export const setNavigationBarColor =
...
@@ -100,7 +100,7 @@ export const setNavigationBarColor =
plus
.
navigator
.
setStatusBarStyle
(
statusBarStyle
)
plus
.
navigator
.
setStatusBarStyle
(
statusBarStyle
)
// 用户调用api时同时改变当前页配置,这样在系统调用设置时,可以避免覆盖用户设置
// 用户调用api时同时改变当前页配置,这样在系统调用设置时,可以避免覆盖用户设置
setPage
Meta
(
statusBarStyle
)
setPage
StatusBarStyle
(
statusBarStyle
)
const
style
=
webview
.
getStyle
()
const
style
=
webview
.
getStyle
()
if
(
style
&&
style
.
titleNView
)
{
if
(
style
&&
style
.
titleNView
)
{
...
...
packages/uni-app-plus/src/service/api/ui/setPageMeta.ts
0 → 100644
浏览文件 @
6ac07c8a
import
{
ComponentPublicInstance
}
from
'
vue
'
import
{
SetPageMetaOptions
}
from
'
@dcloudio/uni-api
'
export
function
setCurrentPageMeta
(
page
:
ComponentPublicInstance
,
options
:
SetPageMetaOptions
)
{
UniServiceJSBridge
.
invokeViewMethod
(
'
setPageMeta
'
,
options
,
page
.
$page
.
id
)
}
packages/uni-app-plus/src/view/framework/viewMethods.ts
浏览文件 @
6ac07c8a
import
{
ComponentPublicInstance
}
from
'
vue
'
import
{
extend
}
from
'
@vue/shared
'
import
{
extend
}
from
'
@vue/shared
'
import
{
import
{
API_LOAD_FONT_FACE
,
API_LOAD_FONT_FACE
,
API_PAGE_SCROLL_TO
,
API_PAGE_SCROLL_TO
,
API_SET_PAGE_META
,
SelectorQueryRequest
,
SelectorQueryRequest
,
}
from
'
@dcloudio/uni-api
'
}
from
'
@dcloudio/uni-api
'
import
{
import
{
...
@@ -9,9 +11,9 @@ import {
...
@@ -9,9 +11,9 @@ import {
registerViewMethod
,
registerViewMethod
,
getCurrentPageId
,
getCurrentPageId
,
}
from
'
@dcloudio/uni-core
'
}
from
'
@dcloudio/uni-core
'
import
{
ComponentPublicInstance
}
from
'
vue
'
import
{
requestComponentInfo
}
from
'
../../../../uni-h5/src/platform
'
import
{
import
{
requestComponentInfo
,
setCurrentPageMeta
,
addIntersectionObserver
,
addIntersectionObserver
,
removeIntersectionObserver
,
removeIntersectionObserver
,
addMediaQueryObserver
,
addMediaQueryObserver
,
...
@@ -65,4 +67,7 @@ export function initViewMethods() {
...
@@ -65,4 +67,7 @@ export function initViewMethods() {
})
})
registerViewMethod
(
pageId
,
API_PAGE_SCROLL_TO
,
pageScrollTo
)
registerViewMethod
(
pageId
,
API_PAGE_SCROLL_TO
,
pageScrollTo
)
registerViewMethod
(
pageId
,
API_LOAD_FONT_FACE
,
loadFontFace
)
registerViewMethod
(
pageId
,
API_LOAD_FONT_FACE
,
loadFontFace
)
registerViewMethod
(
pageId
,
API_SET_PAGE_META
,
(
args
)
=>
{
setCurrentPageMeta
(
null
,
args
)
})
}
}
packages/uni-h5-vite/lib/api.json
浏览文件 @
6ac07c8a
...
@@ -110,6 +110,7 @@
...
@@ -110,6 +110,7 @@
"setLocale"
,
"setLocale"
,
"setNavigationBarColor"
,
"setNavigationBarColor"
,
"setNavigationBarTitle"
,
"setNavigationBarTitle"
,
"setPageMeta"
,
"setRightWindowStyle"
,
"setRightWindowStyle"
,
"setScreenBrightness"
,
"setScreenBrightness"
,
"setStorage"
,
"setStorage"
,
...
...
packages/uni-h5/dist/uni-h5.es.js
浏览文件 @
6ac07c8a
...
@@ -2198,6 +2198,15 @@ function requestComponentInfo(page, reqs, callback) {
...
@@ -2198,6 +2198,15 @@ function requestComponentInfo(page, reqs, callback) {
});
});
callback(result);
callback(result);
}
}
function setCurrentPageMeta(_page, { pageStyle, rootFontSize }) {
if (pageStyle) {
const pageElm = document.querySelector("uni-page-body") || document.body;
pageElm.setAttribute("style", pageStyle);
}
if (rootFontSize && document.documentElement.style.fontSize !== rootFontSize) {
document.documentElement.style.fontSize = rootFontSize;
}
}
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var lookup = /* @__PURE__ */ function() {
var lookup = /* @__PURE__ */ function() {
const lookup2 = new Uint8Array(256);
const lookup2 = new Uint8Array(256);
...
@@ -4437,6 +4446,10 @@ const setLocale = /* @__PURE__ */ defineSyncApi(API_SET_LOCALE, (locale) => {
...
@@ -4437,6 +4446,10 @@ const setLocale = /* @__PURE__ */ defineSyncApi(API_SET_LOCALE, (locale) => {
}
}
return false;
return false;
});
});
const API_SET_PAGE_META = "setPageMeta";
const setPageMeta = /* @__PURE__ */ defineAsyncApi(API_SET_PAGE_META, (options, { resolve }) => {
resolve(setCurrentPageMeta(getCurrentPageVm(), options));
});
const API_GET_SELECTED_TEXT_RANGE = "getSelectedTextRange";
const API_GET_SELECTED_TEXT_RANGE = "getSelectedTextRange";
const getSelectedTextRange$1 = /* @__PURE__ */ defineAsyncApi(API_GET_SELECTED_TEXT_RANGE, (_, { resolve, reject }) => {
const getSelectedTextRange$1 = /* @__PURE__ */ defineAsyncApi(API_GET_SELECTED_TEXT_RANGE, (_, { resolve, reject }) => {
UniServiceJSBridge.invokeViewMethod("getSelectedTextRange", {}, getCurrentPageId(), (res) => {
UniServiceJSBridge.invokeViewMethod("getSelectedTextRange", {}, getCurrentPageId(), (res) => {
...
@@ -18747,10 +18760,10 @@ const setNavigationBarColor = /* @__PURE__ */ defineAsyncApi(API_SET_NAVIGATION_
...
@@ -18747,10 +18760,10 @@ const setNavigationBarColor = /* @__PURE__ */ defineAsyncApi(API_SET_NAVIGATION_
setNavigationBar(getCurrentPageMeta(), API_SET_NAVIGATION_BAR_COLOR, args, resolve, reject);
setNavigationBar(getCurrentPageMeta(), API_SET_NAVIGATION_BAR_COLOR, args, resolve, reject);
}, SetNavigationBarColorProtocol, SetNavigationBarColorOptions);
}, SetNavigationBarColorProtocol, SetNavigationBarColorOptions);
const showNavigationBarLoading = /* @__PURE__ */ defineAsyncApi(API_SHOW_NAVIGATION_BAR_LOADING, (args, { resolve, reject }) => {
const showNavigationBarLoading = /* @__PURE__ */ defineAsyncApi(API_SHOW_NAVIGATION_BAR_LOADING, (args, { resolve, reject }) => {
setNavigationBar(getCurrentPageMeta(), API_SHOW_NAVIGATION_BAR_LOADING, args, resolve, reject);
setNavigationBar(getCurrentPageMeta(), API_SHOW_NAVIGATION_BAR_LOADING, args
|| {}
, resolve, reject);
});
});
const hideNavigationBarLoading = /* @__PURE__ */ defineAsyncApi(API_HIDE_NAVIGATION_BAR_LOADING, (args, { resolve, reject }) => {
const hideNavigationBarLoading = /* @__PURE__ */ defineAsyncApi(API_HIDE_NAVIGATION_BAR_LOADING, (args, { resolve, reject }) => {
setNavigationBar(getCurrentPageMeta(), API_HIDE_NAVIGATION_BAR_LOADING, args, resolve, reject);
setNavigationBar(getCurrentPageMeta(), API_HIDE_NAVIGATION_BAR_LOADING, args
|| {}
, resolve, reject);
});
});
const setNavigationBarTitle = /* @__PURE__ */ defineAsyncApi(API_SET_NAVIGATION_BAR_TITLE, (args, { resolve, reject }) => {
const setNavigationBarTitle = /* @__PURE__ */ defineAsyncApi(API_SET_NAVIGATION_BAR_TITLE, (args, { resolve, reject }) => {
setNavigationBar(getCurrentPageMeta(), API_SET_NAVIGATION_BAR_TITLE, args, resolve, reject);
setNavigationBar(getCurrentPageMeta(), API_SET_NAVIGATION_BAR_TITLE, args, resolve, reject);
...
@@ -19609,6 +19622,7 @@ var api = {
...
@@ -19609,6 +19622,7 @@ var api = {
$emit,
$emit,
onAppLaunch,
onAppLaunch,
onLocaleChange,
onLocaleChange,
setPageMeta,
cssVar,
cssVar,
cssEnv,
cssEnv,
cssConstant,
cssConstant,
...
@@ -21768,4 +21782,4 @@ var index = /* @__PURE__ */ defineSystemComponent({
...
@@ -21768,4 +21782,4 @@ var index = /* @__PURE__ */ defineSystemComponent({
return openBlock(), createBlock("div", clazz, [loadingVNode]);
return openBlock(), createBlock("div", clazz, [loadingVNode]);
}
}
});
});
export { $emit, $off, $on, $once, index$8 as Ad, index$7 as AdContentPage, index$6 as AdDraw, index$1 as AsyncErrorComponent, index as AsyncLoadingComponent, index$y as Button, index$5 as Camera, index$w as Canvas, index$u as Checkbox, index$v as CheckboxGroup, index$a as CoverImage, index$b as CoverView, index$t as Editor, index$A as Form, index$s as Icon, index$r as Image, Input, index$z as Label, LayoutComponent, index$4 as LivePlayer, index$3 as LivePusher, Map$1 as Map, MovableArea, MovableView, index$q as Navigator, index$2 as PageComponent, index$9 as Picker, PickerView, PickerViewColumn, index$p as Progress, index$n as Radio, index$o as RadioGroup, ResizeSensor, index$m as RichText, ScrollView, index$l as Slider, Swiper, SwiperItem, index$k as Switch, index$j as Text, index$i as Textarea, UniServiceJSBridge$1 as UniServiceJSBridge, UniViewJSBridge$1 as UniViewJSBridge, index$e as Video, index$h as View, index$d as WebView, addInterceptor, addPhoneContact, arrayBufferToBase64, base64ToArrayBuffer, canIUse, canvasGetImageData, canvasPutImageData, canvasToTempFilePath, chooseFile, chooseImage, chooseLocation, chooseVideo, clearStorage, clearStorageSync, closeSocket, connectSocket, createAnimation$1 as createAnimation, createCameraContext, createCanvasContext, createInnerAudioContext, createIntersectionObserver, createLivePlayerContext, createMapContext, createMediaQueryObserver, createSelectorQuery, createVideoContext, cssBackdropFilter, cssConstant, cssEnv, cssVar, downloadFile, getApp$1 as getApp, getClipboardData, getCurrentPages$1 as getCurrentPages, getFileInfo, getImageInfo, getLeftWindowStyle, getLocale, getLocation, getNetworkType, getProvider, getRealPath, getRecorderManager, getRightWindowStyle, getSavedFileInfo, getSavedFileList, getScreenBrightness, getSelectedTextRange$1 as getSelectedTextRange, getStorage, getStorageInfo, getStorageInfoSync, getStorageSync, getSystemInfo, getSystemInfoSync, getTopWindowStyle, getVideoInfo, hideKeyboard, hideLeftWindow, hideLoading, hideNavigationBarLoading, hideRightWindow, hideTabBar, hideTabBarRedDot, hideToast, hideTopWindow, interceptors, loadFontFace, login, makePhoneCall, navigateBack, navigateTo, offAccelerometerChange, offCompassChange, offNetworkStatusChange, offWindowResize, onAccelerometerChange, onAppLaunch, onCompassChange, onGyroscopeChange, onLocaleChange, onMemoryWarning, onNetworkStatusChange, onSocketClose, onSocketError, onSocketMessage, onSocketOpen, onTabBarMidButtonTap, onUserCaptureScreen, onWindowResize, openDocument, openLocation, pageScrollTo, index$f as plugin, preloadPage, previewImage, reLaunch, redirectTo, removeInterceptor, removeSavedFileInfo, removeStorage, removeStorageSync, removeTabBarBadge, request, saveFile, saveImageToPhotosAlbum, saveVideoToPhotosAlbum, scanCode, sendSocketMessage, setClipboardData, setKeepScreenOn, setLeftWindowStyle, setLocale, setNavigationBarColor, setNavigationBarTitle, setRightWindowStyle, setScreenBrightness, setStorage, setStorageSync, setTabBarBadge, setTabBarItem, setTabBarStyle, setTopWindowStyle, setupApp, setupPage, setupWindow, showActionSheet, showLeftWindow, showLoading, showModal, showNavigationBarLoading, showRightWindow, showTabBar, showTabBarRedDot, showToast, showTopWindow, startAccelerometer, startCompass, startGyroscope, startPullDownRefresh, stopAccelerometer, stopCompass, stopGyroscope, stopPullDownRefresh, switchTab, uni$1 as uni, uploadFile, upx2px, useI18n, useTabBar, vibrateLong, vibrateShort };
export { $emit, $off, $on, $once, index$8 as Ad, index$7 as AdContentPage, index$6 as AdDraw, index$1 as AsyncErrorComponent, index as AsyncLoadingComponent, index$y as Button, index$5 as Camera, index$w as Canvas, index$u as Checkbox, index$v as CheckboxGroup, index$a as CoverImage, index$b as CoverView, index$t as Editor, index$A as Form, index$s as Icon, index$r as Image, Input, index$z as Label, LayoutComponent, index$4 as LivePlayer, index$3 as LivePusher, Map$1 as Map, MovableArea, MovableView, index$q as Navigator, index$2 as PageComponent, index$9 as Picker, PickerView, PickerViewColumn, index$p as Progress, index$n as Radio, index$o as RadioGroup, ResizeSensor, index$m as RichText, ScrollView, index$l as Slider, Swiper, SwiperItem, index$k as Switch, index$j as Text, index$i as Textarea, UniServiceJSBridge$1 as UniServiceJSBridge, UniViewJSBridge$1 as UniViewJSBridge, index$e as Video, index$h as View, index$d as WebView, addInterceptor, addPhoneContact, arrayBufferToBase64, base64ToArrayBuffer, canIUse, canvasGetImageData, canvasPutImageData, canvasToTempFilePath, chooseFile, chooseImage, chooseLocation, chooseVideo, clearStorage, clearStorageSync, closeSocket, connectSocket, createAnimation$1 as createAnimation, createCameraContext, createCanvasContext, createInnerAudioContext, createIntersectionObserver, createLivePlayerContext, createMapContext, createMediaQueryObserver, createSelectorQuery, createVideoContext, cssBackdropFilter, cssConstant, cssEnv, cssVar, downloadFile, getApp$1 as getApp, getClipboardData, getCurrentPages$1 as getCurrentPages, getFileInfo, getImageInfo, getLeftWindowStyle, getLocale, getLocation, getNetworkType, getProvider, getRealPath, getRecorderManager, getRightWindowStyle, getSavedFileInfo, getSavedFileList, getScreenBrightness, getSelectedTextRange$1 as getSelectedTextRange, getStorage, getStorageInfo, getStorageInfoSync, getStorageSync, getSystemInfo, getSystemInfoSync, getTopWindowStyle, getVideoInfo, hideKeyboard, hideLeftWindow, hideLoading, hideNavigationBarLoading, hideRightWindow, hideTabBar, hideTabBarRedDot, hideToast, hideTopWindow, interceptors, loadFontFace, login, makePhoneCall, navigateBack, navigateTo, offAccelerometerChange, offCompassChange, offNetworkStatusChange, offWindowResize, onAccelerometerChange, onAppLaunch, onCompassChange, onGyroscopeChange, onLocaleChange, onMemoryWarning, onNetworkStatusChange, onSocketClose, onSocketError, onSocketMessage, onSocketOpen, onTabBarMidButtonTap, onUserCaptureScreen, onWindowResize, openDocument, openLocation, pageScrollTo, index$f as plugin, preloadPage, previewImage, reLaunch, redirectTo, removeInterceptor, removeSavedFileInfo, removeStorage, removeStorageSync, removeTabBarBadge, request, saveFile, saveImageToPhotosAlbum, saveVideoToPhotosAlbum, scanCode, sendSocketMessage, setClipboardData, setKeepScreenOn, setLeftWindowStyle, setLocale, setNavigationBarColor, setNavigationBarTitle, set
PageMeta, set
RightWindowStyle, setScreenBrightness, setStorage, setStorageSync, setTabBarBadge, setTabBarItem, setTabBarStyle, setTopWindowStyle, setupApp, setupPage, setupWindow, showActionSheet, showLeftWindow, showLoading, showModal, showNavigationBarLoading, showRightWindow, showTabBar, showTabBarRedDot, showToast, showTopWindow, startAccelerometer, startCompass, startGyroscope, startPullDownRefresh, stopAccelerometer, stopCompass, stopGyroscope, stopPullDownRefresh, switchTab, uni$1 as uni, uploadFile, upx2px, useI18n, useTabBar, vibrateLong, vibrateShort };
packages/uni-h5/src/platform/index.ts
浏览文件 @
6ac07c8a
...
@@ -3,6 +3,7 @@ export { getBaseSystemInfo } from '../service/api/base/getBaseSystemInfo'
...
@@ -3,6 +3,7 @@ export { getBaseSystemInfo } from '../service/api/base/getBaseSystemInfo'
export
{
operateVideoPlayer
}
from
'
../service/api/context/operateVideoPlayer
'
export
{
operateVideoPlayer
}
from
'
../service/api/context/operateVideoPlayer
'
export
{
operateMap
}
from
'
../service/api/context/operateMap
'
export
{
operateMap
}
from
'
../service/api/context/operateMap
'
export
{
requestComponentInfo
}
from
'
../service/api/ui/requestComponentInfo
'
export
{
requestComponentInfo
}
from
'
../service/api/ui/requestComponentInfo
'
export
{
setCurrentPageMeta
}
from
'
../service/api/ui/setPageMeta
'
export
{
export
{
addIntersectionObserver
,
addIntersectionObserver
,
removeIntersectionObserver
,
removeIntersectionObserver
,
...
...
packages/uni-h5/src/service/api/index.ts
浏览文件 @
6ac07c8a
...
@@ -94,5 +94,6 @@ export {
...
@@ -94,5 +94,6 @@ export {
$emit
,
$emit
,
onAppLaunch
,
onAppLaunch
,
onLocaleChange
,
onLocaleChange
,
setPageMeta
,
}
from
'
@dcloudio/uni-api
'
}
from
'
@dcloudio/uni-api
'
//#endif
//#endif
packages/uni-h5/src/service/api/ui/navigationBar.ts
浏览文件 @
6ac07c8a
...
@@ -97,7 +97,7 @@ export const showNavigationBarLoading =
...
@@ -97,7 +97,7 @@ export const showNavigationBarLoading =
setNavigationBar
(
setNavigationBar
(
getCurrentPageMeta
(),
getCurrentPageMeta
(),
API_SHOW_NAVIGATION_BAR_LOADING
,
API_SHOW_NAVIGATION_BAR_LOADING
,
args
,
args
||
{}
,
resolve
,
resolve
,
reject
reject
)
)
...
@@ -111,7 +111,7 @@ export const hideNavigationBarLoading =
...
@@ -111,7 +111,7 @@ export const hideNavigationBarLoading =
setNavigationBar
(
setNavigationBar
(
getCurrentPageMeta
(),
getCurrentPageMeta
(),
API_HIDE_NAVIGATION_BAR_LOADING
,
API_HIDE_NAVIGATION_BAR_LOADING
,
args
,
args
||
{}
,
resolve
,
resolve
,
reject
reject
)
)
...
...
packages/uni-h5/src/service/api/ui/setPageMeta.ts
0 → 100644
浏览文件 @
6ac07c8a
import
{
ComponentPublicInstance
}
from
'
vue
'
import
{
SetPageMetaOptions
}
from
'
@dcloudio/uni-api
'
export
function
setCurrentPageMeta
(
_page
:
ComponentPublicInstance
|
null
,
{
pageStyle
,
rootFontSize
}:
SetPageMetaOptions
)
{
if
(
pageStyle
)
{
const
pageElm
=
document
.
querySelector
(
'
uni-page-body
'
)
||
document
.
body
pageElm
.
setAttribute
(
'
style
'
,
pageStyle
)
}
if
(
rootFontSize
&&
document
.
documentElement
.
style
.
fontSize
!==
rootFontSize
)
{
document
.
documentElement
.
style
.
fontSize
=
rootFontSize
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录