提交 b2a3bbcd 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

feat(API): theme change

上级 1b8592c2
...@@ -1310,6 +1310,13 @@ ...@@ -1310,6 +1310,13 @@
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
{
"path": "pages/API/theme-change/theme-change",
"style": {
"navigationBarTitleText": "主题切换",
"enablePullDownRefresh": false
}
},
{ {
"path": "uni_modules/uni-pay-x/pages/success/success", "path": "uni_modules/uni-pay-x/pages/success/success",
"style": { "style": {
......
<template>
<view class="uni-padding-wrap">
<view class="uni-common-mt flex justify-between flex-row">
<text>theme:</text>
<text id="theme">{{ dataInfo.theme }}</text>
</view>
<view class="uni-common-mt flex justify-between flex-row">
<text>fn1 trigger num:</text>
<text id="fn1-trigger-num">{{ dataInfo.fn1TriggerNum }}</text>
</view>
<view class="uni-common-mt flex justify-between flex-row">
<text>fn2 trigger num:</text>
<text id="fn2-trigger-num">{{ dataInfo.fn2TriggerNum }}</text>
</view>
<button class="uni-common-mt" id="bind-fn1" @click="bindFn1">
bind fn1
</button>
<button class="uni-common-mt" id="remove-fn1" @click="removeFn1">
remove fn1
</button>
<button class="uni-common-mt" id="bind-fn2" @click="bindFn2">
bind fn2
</button>
<button class="uni-common-mt" id="remove-fn2" @click="removeFn2">
remove fn2
</button>
</view>
</template>
<script setup lang="uts">
type DataInfo = {
fn1TriggerNum: number
fn2TriggerNum: number
theme: string
}
const dataInfo = reactive<DataInfo>({
fn1TriggerNum: 0,
fn2TriggerNum: 0,
theme: ''
})
const fn1 = (options : OnThemeChangeOptions) => {
dataInfo.fn1TriggerNum++
console.log('fn1 triggered options: ', options)
dataInfo.theme = options.theme
}
const fn2 = (options : OnThemeChangeOptions) => {
dataInfo.fn2TriggerNum++
console.log('fn2 triggered options: ', options)
dataInfo.theme = options.theme
}
const bindFn1 = () => {
uni.onOSThemeChange(fn1)
}
const removeFn1 = () => {
uni.offOSThemeChange(fn1)
}
const bindFn2 = () => {
uni.onOSThemeChange(fn2)
}
const removeFn2 = () => {
uni.offOSThemeChange(fn2)
}
onReady(() => {
bindFn1()
bindFn2()
})
</script>
<style>
.flex {
display: flex;
}
.flex-row {
flex-direction: row;
}
.justify-between {
justify-content: space-between;
}
</style>
<template> <template>
<!-- #ifdef APP --> <!-- #ifdef APP -->
<scroll-view style="flex: 1" enable-back-to-top="true"> <scroll-view style="flex: 1" enable-back-to-top="true">
<!-- #endif --> <!-- #endif -->
<view class="uni-container"> <view class="uni-container">
<view class="uni-header-logo"> <view class="uni-header-logo">
<image class="uni-header-image" src="/static/apiIndex.png"></image> <image class="uni-header-image" src="/static/apiIndex.png"></image>
</view> </view>
<view class="uni-text-box"> <view class="uni-text-box">
<text class="hello-text">以下将演示uni-app接口能力,详细文档见:</text> <text class="hello-text">以下将演示uni-app接口能力,详细文档见:</text>
<u-link :href="'https://uniapp.dcloud.io/uni-app-x/api/'" :text="'https://uniapp.dcloud.io/uni-app-x/api/'" :inWhiteList="true"></u-link> <u-link :href="'https://uniapp.dcloud.io/uni-app-x/api/'" :text="'https://uniapp.dcloud.io/uni-app-x/api/'"
</view> :inWhiteList="true"></u-link>
</view>
<uni-collapse>
<template v-for="item in list" :key="item.id"> <uni-collapse>
<uni-collapse-item :title="item.name" class="item"> <template v-for="item in list" :key="item.id">
<view class="uni-navigate-item" :hover-class="page.enable == false?'':'is--active'" v-for="(page, key) in item.pages" :key="key" @click="goDetailPage(page)"> <uni-collapse-item :title="item.name" class="item">
<text class="uni-navigate-text" :class="page.enable == false ? 'text-disabled' : ''">{{ page.name }}</text> <view class="uni-navigate-item" :hover-class="page.enable == false ? '' : 'is--active'"
<image :src="arrowRightIcon" class="uni-icon-size"></image> v-for="(page, key) in item.pages" :key="key" @click="goDetailPage(page)">
</view> <text class="uni-navigate-text"
</uni-collapse-item> :class="page.enable == false ? 'text-disabled' : ''">{{ page.name }}</text>
</template> <image :src="arrowRightIcon" class="uni-icon-size"></image>
</uni-collapse> </view>
</uni-collapse-item>
</view> </template>
<!-- #ifdef APP --> </uni-collapse>
</scroll-view> </view>
<!-- #endif --> <!-- #ifdef APP -->
<view ref="pop" @click="hidePop()" class="popup"> </scroll-view>
<view style="width: 90%;background-color: white;" @click="stopClickPop"> <!-- #endif -->
<api-set-tabbar></api-set-tabbar> <view ref="pop" @click="hidePop()" class="popup">
</view> <view style="width: 90%; background-color: white" @click="stopClickPop">
</view> <api-set-tabbar></api-set-tabbar>
</template> </view>
</view>
<script lang="uts"> </template>
type Page = {
name : string <script lang="uts">
url : string type Page = {
enable ?: boolean name : string
api ?: Array<string> url : string
} enable ?: boolean
type ListItem = { api ?: Array<string>
id : string }
name : string type ListItem = {
pages : Page[] id : string
url ?: string name : string
enable ?: boolean pages : Page[]
} url ?: string
export default { enable ?: boolean
data() { }
return { export default {
list: [ data() {
{ return {
id: 'global', list: [
name: '全局', {
pages: [ id: 'global',
{ name: '全局',
name: 'getApp', pages: [
url: 'get-app', {
}, name: 'getApp',
{ url: 'get-app',
name: 'getCurrentPages', },
url: 'get-current-pages', {
} name: 'getCurrentPages',
] as Page[], url: 'get-current-pages',
}, }
{ ] as Page[],
id: 'base', },
name: '基础', {
pages: [ id: 'base',
{ name: '基础',
name: '事件总线event-bus', pages: [
url: 'event-bus', {
api: ["$on", "$once", "$off", "$emit"] name: '事件总线event-bus',
}, url: 'event-bus',
{ api: ["$on", "$once", "$off", "$emit"]
name: '拦截器', },
url: 'interceptor', {
api: ["addInterceptor", "removeInterceptor"] name: '拦截器',
}, url: 'interceptor',
{ api: ["addInterceptor", "removeInterceptor"]
name: '获取启动参数', },
url: 'get-launch-options-sync', {
}, name: '获取启动参数',
// #ifdef APP-ANDROID url: 'get-launch-options-sync',
{ },
name: '退出应用', // #ifdef APP-ANDROID
url: 'exit', {
}, name: '退出应用',
// #endif url: 'exit',
] as Page[], },
}, // #endif
{ ] as Page[],
id: 'page', },
name: '页面和路由', {
pages: [ id: 'page',
{ name: '页面和路由',
name: '页面跳转', pages: [
url: 'navigator', {
api: ["navigateTo", "reLaunch", "navigateBack", "redirectTo", "switchTab"] name: '页面跳转',
}, url: 'navigator',
api: ["navigateTo", "reLaunch", "navigateBack", "redirectTo", "switchTab"]
{ },
name: '设置导航条标题',
url: 'set-navigation-bar-title', {
}, name: '设置导航条标题',
{ url: 'set-navigation-bar-title',
name: '设置导航条颜色', },
url: 'set-navigation-bar-color', {
}, name: '设置导航条颜色',
{ url: 'set-navigation-bar-color',
name: '设置页面容器背景色', },
url: 'set-page-backgroundColorContent', {
}, name: '设置页面容器背景色',
{ url: 'set-page-backgroundColorContent',
name: '设置TabBar', },
url: 'set-tabbar', {
api: ["showTabBar", "hideTabBar", "showTabBarRedDot", "hideTabBarRedDot", "setTabBarBadge", "removeTabBarBadge", "setTabBarStyle", "setTabBarItem"] name: '设置TabBar',
}, url: 'set-tabbar',
{ api: ["showTabBar", "hideTabBar", "showTabBarRedDot", "hideTabBarRedDot", "setTabBarBadge", "removeTabBarBadge", "setTabBarStyle", "setTabBarItem"]
name: '页面下拉刷新', },
url: 'pull-down-refresh', {
api: ["stopPullDownRefresh"] name: '页面下拉刷新',
}, url: 'pull-down-refresh',
{ api: ["stopPullDownRefresh"]
name: '将页面滚动到指定位置', },
url: 'page-scroll-to', {
}, name: '将页面滚动到指定位置',
] as Page[], url: 'page-scroll-to',
}, },
{ ] as Page[],
id: 'ui', },
name: '界面', {
pages: [ id: 'ui',
// { name: '界面',
// name: "创建动画", pages: [
// url: "animation", // {
// enable: false // name: "创建动画",
// }, // url: "animation",
// { // enable: false
// name: "创建绘画", // },
// url: "canvas", // {
// enable: true // name: "创建绘画",
// }, // url: "canvas",
// { // enable: true
// name: "节点布局交互状态", // },
// url: "intersection-observer", // {
// enable: false // name: "节点布局交互状态",
// }, // url: "intersection-observer",
{ // enable: false
name: 'element元素', // },
url: 'get-element-by-id', {
api: ["getElementById"], name: 'element元素',
}, url: 'get-element-by-id',
// #ifdef APP api: ["getElementById"],
{ },
name: 'element draw', // #ifdef APP
url: 'element-draw', {
api: ["Element.getDrawableContext"] name: 'element draw',
}, { url: 'element-draw',
name: 'element截图', api: ["Element.getDrawableContext"]
url: 'element-takesnapshot', }, {
api: ["Element.takeSnapshot"] name: 'element截图',
}, url: 'element-takesnapshot',
// #endif api: ["Element.takeSnapshot"]
// #ifdef APP-ANDROID || WEB },
{ // #endif
name: 'element大小变化监听', // #ifdef APP-ANDROID || WEB
url: 'resize-observer' {
}, name: 'element大小变化监听',
// #endif url: 'resize-observer'
{ },
name: 'node节点', // #endif
url: 'nodes-info', {
api: ["createSelectorQuery"] name: 'node节点',
}, url: 'nodes-info',
{ api: ["createSelectorQuery"]
name: '动态加载字体', },
url: 'load-font-face', {
}, name: '动态加载字体',
{ url: 'load-font-face',
name: 'rpx2px', },
url: 'rpx2px' {
}, name: 'rpx2px',
{ url: 'rpx2px'
name: 'actionSheet操作菜单', },
url: 'action-sheet', {
}, name: 'actionSheet操作菜单',
{ url: 'action-sheet',
name: 'showModal模态弹窗', },
url: 'modal', {
api: ["showModal"] name: 'showModal模态弹窗',
}, url: 'modal',
{ api: ["showModal"]
name: 'showLoading等待框', },
url: 'loading', {
}, name: 'showLoading等待框',
{ url: 'loading',
name: 'showToast轻提示框', },
url: 'toast', {
api: ["showToast"] name: 'showToast轻提示框',
} url: 'toast',
] as Page[], api: ["showToast"]
}, }
{ ] as Page[],
id: 'network', },
name: '网络', {
pages: [ id: 'network',
{ name: '网络',
name: '发起请求request', pages: [
url: 'request', {
}, name: '发起请求request',
{ url: 'request',
name: '上传文件', },
url: 'upload-file', {
}, name: '上传文件',
{ url: 'upload-file',
name: '下载文件', },
url: 'download-file', {
}, name: '下载文件',
{ url: 'download-file',
name: '获取设备网络状态', },
url: 'get-network-type', {
}, name: '获取设备网络状态',
{ url: 'get-network-type',
name: 'socketTask', },
url: 'websocket-socketTask', {
api: [""] //它不是uni.的api name: 'socketTask',
}, url: 'websocket-socketTask',
{ api: [""] //它不是uni.的api
name: '全局websocket', },
url: 'websocket-global', {
api: ["connectSocket", "onSocketOpen", "onSocketError", "sendSocketMessage", "onSocketMessage", "closeSocket", "onSocketClose"] name: '全局websocket',
}, url: 'websocket-global',
] as Page[], api: ["connectSocket", "onSocketOpen", "onSocketError", "sendSocketMessage", "onSocketMessage", "closeSocket", "onSocketClose"]
}, },
{ ] as Page[],
id: 'device', },
name: '设备', {
pages: [ id: 'device',
{ name: '设备',
name: '获取系统信息', pages: [
url: 'get-system-info', {
}, name: '获取系统信息',
{ url: 'get-system-info',
name: '获取设备信息', },
url: 'get-device-info', {
}, name: '获取设备信息',
{ url: 'get-device-info',
name: '获取窗口信息', },
url: 'get-window-info', {
}, name: '获取窗口信息',
{ url: 'get-window-info',
name: '获取APP基础信息', },
url: 'get-app-base-info', {
}, name: '获取APP基础信息',
// #ifdef APP url: 'get-app-base-info',
{ },
name: '获取APP授权设置', // #ifdef APP
url: 'get-app-authorize-setting', {
}, name: '获取APP授权设置',
{ url: 'get-app-authorize-setting',
name: '获取系统设置', },
url: 'get-system-setting', {
}, name: '获取系统设置',
// #endif url: 'get-system-setting',
{ },
name: '电量', // #endif
url: 'get-battery-info', {
}, name: '电量',
// #ifdef APP-ANDROID url: 'get-battery-info',
{ },
name: '安装Apk', // #ifdef APP-ANDROID
url: 'install-apk' {
}, name: '安装Apk',
// #endif url: 'install-apk'
/* { },
name: "打电话", // #endif
url: "make-phone-call", /* {
}, name: "打电话",
{ url: "make-phone-call",
name: "震动", },
url: "vibrate", {
}, name: "震动",
{ url: "vibrate",
name: "添加手机联系人", },
url: "add-phone-contact", {
}, name: "添加手机联系人",
{ url: "add-phone-contact",
name: "扫码", },
url: "scan-code", {
}, name: "扫码",
{ url: "scan-code",
name: "剪贴板", },
url: "clipboard", {
}, name: "剪贴板",
{ url: "clipboard",
name: "屏幕亮度", },
url: "brightness", {
}, name: "屏幕亮度",
{ url: "brightness",
name: "蓝牙", },
url: "bluetooth", {
}, name: "蓝牙",
{ url: "bluetooth",
name: "生物认证", },
url: "soter", {
}, name: "生物认证",
{ url: "soter",
name: "iBeacon", },
url: "ibeacon", {
}, name: "iBeacon",
{ url: "ibeacon",
name: "监听加速度传感器", },
url: "on-accelerometer-change", {
}, name: "监听加速度传感器",
{ url: "on-accelerometer-change",
name: "监听罗盘数据", },
url: "on-compass-change", {
}, name: "监听罗盘数据",
{ url: "on-compass-change",
name: "监听距离传感器", },
url: "/platforms/app-plus/proximity/proximity", {
}, name: "监听距离传感器",
{ url: "/platforms/app-plus/proximity/proximity",
name: "监听方向传感器", },
url: "/platforms/app-plus/orientation/orientation", {
}, */ name: "监听方向传感器",
] as Page[], url: "/platforms/app-plus/orientation/orientation",
}, }, */
{ ] as Page[],
id: 'media', },
name: '媒体', {
pages: [ id: 'media',
{ name: '媒体',
name: "拍摄图片或从相册中选择图片", pages: [
url: 'choose-image' {
}, name: "拍摄图片或从相册中选择图片",
{ url: 'choose-image'
name: '图片预览', },
url: 'preview-image', {
api: ["previewImage", "closePreviewImage"] name: '图片预览',
}, url: 'preview-image',
// #ifdef APP api: ["previewImage", "closePreviewImage"]
{ },
name: "保存图片到相册", // #ifdef APP
url: 'save-image-to-photos-album' {
}, name: "保存图片到相册",
// #endif url: 'save-image-to-photos-album'
// #ifdef APP-ANDROID || WEB },
{ // #endif
name: "获取图片信息", // #ifdef APP-ANDROID || WEB
url: 'get-image-info' {
}, name: "获取图片信息",
// #endif url: 'get-image-info'
// #ifdef APP-ANDROID },
{ // #endif
name: "压缩图片", // #ifdef APP-ANDROID
url: 'compress-image' {
}, name: "压缩图片",
// #endif url: 'compress-image'
{ },
name: "拍摄视频或从相册中选择视频", // #endif
url: 'choose-video' {
}, name: "拍摄视频或从相册中选择视频",
// #ifdef APP url: 'choose-video'
{ },
name: "保存视频到相册", // #ifdef APP
url: 'save-video-to-photos-album' {
}, name: "保存视频到相册",
// #endif url: 'save-video-to-photos-album'
// #ifdef APP-ANDROID || WEB },
{ // #endif
name: "获取视频信息", // #ifdef APP-ANDROID || WEB
url: 'get-video-info' {
}, name: "获取视频信息",
// #endif url: 'get-video-info'
// #ifdef APP-ANDROID },
{ // #endif
name: "压缩视频", // #ifdef APP-ANDROID
url: 'compress-video' {
}, name: "压缩视频",
// #endif url: 'compress-video'
/* { },
name: "音频", // #endif
url: "inner-audio", /* {
}, name: "音频",
{ url: "inner-audio",
name: "背景音频", },
url: "background-audio", {
}, name: "背景音频",
{ url: "background-audio",
name: "录音", },
url: "rec", {
}, name: "录音",
{ url: "rec",
name: "文件", },
url: "file", {
}, name: "文件",
*/ url: "file",
] as Page[], },
}, */
{ ] as Page[],
id: 'location', },
name: '位置', {
pages: [ id: 'location',
{ name: '位置',
name: '获取当前位置', pages: [
url: 'get-location', {
}, name: '获取当前位置',
/* { url: 'get-location',
name: "使用地图查看位置", },
url: "open-location", /* {
}, name: "使用地图查看位置",
{ url: "open-location",
name: "使用地图选择位置", },
url: "choose-location", {
}, name: "使用地图选择位置",
{ url: "choose-location",
name: "地图控制", },
url: "map", {
}, name: "地图控制",
{ url: "map",
name: "地图搜索", },
url: "map-search", {
}, */ name: "地图搜索",
] as Page[], url: "map-search",
}, }, */
{ ] as Page[],
id: 'storage', },
name: '数据存储', {
pages: [ id: 'storage',
{ name: '数据存储',
name: 'storage(key-value存储)', pages: [
url: 'storage', {
api: ["getStorageInfo", "getStorageInfoSync", "getStorage", "getStorageSync", "setStorage", "setStorageSync", "removeStorage", "removeStorageSync", "clearStorage", "clearStorageSync"] name: 'storage(key-value存储)',
} url: 'storage',
] as Page[], api: ["getStorageInfo", "getStorageInfoSync", "getStorage", "getStorageSync", "setStorage", "setStorageSync", "removeStorage", "removeStorageSync", "clearStorage", "clearStorageSync"]
}, }
// #ifdef APP ] as Page[],
{ },
id: 'file', // #ifdef APP
name: '文件', {
pages: [ id: 'file',
{ name: '文件',
name: 'fileSystemManager文件管理', pages: [
url: 'get-file-system-manager' {
}, name: 'fileSystemManager文件管理',
] as Page[], url: 'get-file-system-manager'
}, },
// #endif ] as Page[],
{ },
id: 'unicloud', // #endif
name: 'uniCloud', {
pages: [ id: 'unicloud',
{ name: 'uniCloud',
name: '云函数', pages: [
url: 'unicloud-call-function', {
}, name: '云函数',
{ url: 'unicloud-call-function',
name: '云对象', },
url: 'unicloud-import-object', {
}, name: '云对象',
{ url: 'unicloud-import-object',
name: '云存储', },
url: 'unicloud-file-api', {
}, name: '云存储',
{ url: 'unicloud-file-api',
name: 'clientDB', },
url: 'unicloud-database', {
}, name: 'clientDB',
] as Page[], url: 'unicloud-database',
}, },
// #ifdef APP ] as Page[],
{ },
id: 'login', // #ifdef APP
name: '登录与认证', {
pages: [ id: 'login',
{ name: '登录与认证',
name: '一键登录', pages: [
url: 'get-univerify-manager', {
}, name: '一键登录',
{ url: 'get-univerify-manager',
name: '实人认证', },
url: 'facial-recognition-verify', {
} name: '实人认证',
] as Page[], url: 'facial-recognition-verify',
}, }
// #endif ] as Page[],
{ },
id: "payment", // #endif
name: "支付", {
pages: [ id: "payment",
// #ifndef WEB name: "支付",
{ pages: [
name: "简易支付示例", // #ifndef WEB
url: "request-payment", {
}, name: "简易支付示例",
// #endif url: "request-payment",
{ },
name: "uni-pay支付示例", // #endif
url: "request-payment-uni-pay", {
} name: "uni-pay支付示例",
] as Page[], url: "request-payment-uni-pay",
}, }
// #ifdef APP-ANDROID ] as Page[],
{ },
id: 'ad', // #ifdef APP-ANDROID
name: '广告', {
pages: [ id: 'ad',
{ name: '广告',
name: '激励视频广告', pages: [
url: 'rewarded-video-ad', {
} name: '激励视频广告',
/* { url: 'rewarded-video-ad',
id: "full-screen-video-ad", }
url: "full-screen-video-ad", /* {
name: "全屏视频广告", id: "full-screen-video-ad",
enable: false, url: "full-screen-video-ad",
pages: [] as Page[] name: "全屏视频广告",
}, */ enable: false,
] as Page[], pages: [] as Page[]
}, }, */
{ ] as Page[],
id: 'permission-listener', },
name: '权限申请监听', {
pages: [ id: 'permission-listener',
{ name: '权限申请监听',
name: '权限申请监听', pages: [
url: 'create-request-permission-listener', {
} name: '权限申请监听',
] as Page[] url: 'create-request-permission-listener',
}, }
// #endif ] as Page[]
/* },
{ {
id: "share", id: 'theme-change',
name: "分享", name: '主题切换',
pages: [ pages: [
{ {
name: "分享", name: '主题切换',
url: "share", url: 'theme-change',
}, }
] as Page[], ] as Page[]
}, },
*/ // #endif
] as ListItem[], /*
arrowUpIcon: '/static/icons/arrow-up.png', {
arrowDownIcon: '/static/icons/arrow-down.png', id: "share",
arrowRightIcon: '/static/icons/arrow-right.png', name: "分享",
} pages: [
}, {
onLoad() { name: "分享",
// console.log("API page onLoad") url: "share",
}, },
onShow() { ] as Page[],
// console.log("API page onShow") },
}, */
onHide() { ] as ListItem[],
// console.log("API page onHide") arrowUpIcon: '/static/icons/arrow-up.png',
}, arrowDownIcon: '/static/icons/arrow-down.png',
methods: { arrowRightIcon: '/static/icons/arrow-right.png',
goDetailPage(e : Page) { }
if (e.enable == false) { },
uni.showToast({ onLoad() {
title: '暂不支持', // console.log("API page onLoad")
icon: 'none', },
}) onShow() {
return // console.log("API page onShow")
} },
if (e.url === 'set-tabbar') { onHide() {
this.showPop() // console.log("API page onHide")
return; },
} methods: {
const url = goDetailPage(e : Page) {
e.url.indexOf('platform') > -1 ? e.url : `/pages/API/${e.url}/${e.url}` if (e.enable == false) {
uni.navigateTo({ uni.showToast({
url, title: '暂不支持',
}) icon: 'none',
}, })
showPop: function () { return
(this.$refs["pop"] as UniElement).style.setProperty("display", "flex") }
}, if (e.url === 'set-tabbar') {
hidePop: function () { this.showPop()
(this.$refs["pop"] as UniElement).style.setProperty("display", "none") return;
}, }
stopClickPop: function (e : PointerEvent) { const url =
e.stopPropagation() //点击到pop的非灰色区域,拦截点击事件 e.url.indexOf('platform') > -1 ? e.url : `/pages/API/${e.url}/${e.url}`
} uni.navigateTo({
}, url,
} })
</script> },
showPop: function () {
<style> (this.$refs["pop"] as UniElement).style.setProperty("display", "flex")
.item { },
margin-bottom: 12px; hidePop: function () {
} (this.$refs["pop"] as UniElement).style.setProperty("display", "none")
},
.popup { stopClickPop: function (e : PointerEvent) {
width: 100%; e.stopPropagation() //点击到pop的非灰色区域,拦截点击事件
/* #ifdef APP */ }
position: absolute; },
height: 100%; }
/* #endif */ </script>
/* #ifndef APP */
position: fixed; <style>
top: var(--window-top); .item {
bottom: var(--window-bottom); margin-bottom: 12px;
/* #endif */ }
align-items: center;
justify-content: center; .popup {
display: none; width: 100%;
background-color: rgba(16, 16, 16, 0.5); /* #ifdef APP */
} position: absolute;
height: 100%;
/* #endif */
/* #ifndef APP */
position: fixed;
top: var(--window-top);
bottom: var(--window-bottom);
/* #endif */
align-items: center;
justify-content: center;
display: none;
background-color: rgba(16, 16, 16, 0.5);
}
</style> </style>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册