Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
70df8b55
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
6003
Star
91
Fork
163
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
18
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello uni-app x
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
18
Issue
18
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
70df8b55
编写于
9月 25, 2024
作者:
DCloud-WZF
💬
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor(getCurrentPages): 移除类型警告
上级
a3802864
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
94 addition
and
59 deletion
+94
-59
pages/API/get-current-pages/get-current-pages.uvue
pages/API/get-current-pages/get-current-pages.uvue
+94
-59
未找到文件。
pages/API/get-current-pages/get-current-pages.uvue
浏览文件 @
70df8b55
<template>
<!-- #ifdef APP -->
<scroll-view class="page-scroll-view">
<!-- #endif -->
<!-- #endif -->
<view>
<page-head title="getCurrentPages"></page-head>
<view class="uni-padding-wrap">
...
...
@@ -9,45 +9,78 @@
<view v-if="pages.length" style="padding: 15px 0px">
<text>当前页面栈中 {{ pages.length }} 个页面,列表如下:</text>
<template v-for="(page, index) in pages" :key="page.route">
<text style="margin-top: 5px">index: {{ index }}, route: {{ page.route }}</text>
<text style="margin-top: 5px"
>index: {{ index }}, route: {{ page.route }}</text
>
</template>
</view>
<button class="uni-common-mt" @click="check$page">check $page</button>
<button class="uni-common-mt" @click="checkGetParentPage">check getParentPage</button>
<button class="uni-common-mt" @click="checkGetDialogPages">check getDialogPages</button>
<button id="check-get-element-by-id-btn" class="uni-common-mt" @click="checkGetElementById">check
getElementById</button>
<button class="uni-common-mt" @click="checkGetAndroidView">check getAndroidView</button>
<button class="uni-common-mt" @click="checkGetParentPage">
check getParentPage
</button>
<button class="uni-common-mt" @click="checkGetDialogPages">
check getDialogPages
</button>
<button
id="check-get-element-by-id-btn"
class="uni-common-mt"
@click="checkGetElementById"
>
check getElementById
</button>
<button class="uni-common-mt" @click="checkGetAndroidView">
check getAndroidView
</button>
</view>
<page-head title="currentPageStyle"></page-head>
<template v-for="(item, index) in PageStyleArray">
<view class="page-style-item" v-if="currentPageStyle[item.key]!=null" :key="index">
<view
class="page-style-item"
v-if="currentPageStyle[item.key] != null"
:key="index"
>
<view class="item-text">
<text class="item-text-key">{{item.key}}:</text>
<text class="item-text-value">{{currentPageStyle[item.key]}}</text>
<text class="item-text-key">{{ item.key }}:</text>
<text class="item-text-value">{{
currentPageStyle[item.key]
}}</text>
</view>
<view class="set-value" v-if="item.type == 'boolean'">
<switch :checked="currentPageStyle.getBoolean(item.key)"
@change="switchChange(item.key, $event as UniSwitchChangeEvent)">
<switch
:checked="currentPageStyle.getBoolean(item.key)"
@change="switchChange(item.key, $event as UniSwitchChangeEvent)"
>
</switch>
</view>
<view class="set-value" v-else-if="item.type == 'number'">
<slider :value="currentPageStyle.getNumber(item.key)" :show-value="true"
@change="sliderChange(item.key, $event as UniSliderChangeEvent)" />
<slider
:value="currentPageStyle.getNumber(item.key)"
:show-value="true"
@change="sliderChange(item.key, $event as UniSliderChangeEvent)"
/>
</view>
<view class="set-value" v-else-if="item.type == 'string'">
<radio-group class="radio-set-value" @change="radioChange(item.key, $event as RadioGroupChangeEvent)">
<radio class="radio-value" v-for="(item2, index2) in item.value" :key="index2" :value="item2">{{item2}}
<radio-group
class="radio-set-value"
@change="radioChange(item.key, $event as RadioGroupChangeEvent)"
>
<radio
class="radio-value"
v-for="(item2, index2) in item.value"
:key="index2"
:value="item2"
>{{ item2 }}
</radio>
</radio-group>
</view>
</view>
</template>
<button style='margin: 10px;' @click="goSetDisablePullDownRefresh">go set disable pullDownRefresh</button>
<button style="margin: 10px" @click="goSetDisablePullDownRefresh">
go set disable pullDownRefresh
</button>
</view>
<!-- #ifdef APP -->
<!-- #ifdef APP -->
</scroll-view>
<!-- #endif -->
</template>
...
...
@@ -141,14 +174,16 @@
check$page() : boolean {
const page = this.getCurrentPage()
let res = this.$page === page
if (this.testing) {
res = res && page.options.get('test') == '123'
// #ifdef WEB
res = page.route == '/pages/API/get-current-pages/get-current-pages'
// #endif
// #ifndef WEB
res = page.route == 'pages/API/get-current-pages/get-current-pages'
// #endif
if (this.testing && res) {
res = page.options.get('test') == '123'
if (res) {
// #ifdef WEB
res = page.route == '/pages/API/get-current-pages/get-current-pages'
// #endif
// #ifndef WEB
res = page.route == 'pages/API/get-current-pages/get-current-pages'
// #endif
}
}
console.log('check $page', res)
return res
...
...
@@ -198,43 +233,43 @@
</script>
<style>
.page {
flex: 1;
padding: 10px;
}
.page {
flex: 1;
padding: 10px;
}
.page-style {
margin-top: 15px;
}
.page-style {
margin-top: 15px;
}
.page-style-item {
padding: 10px;
margin-top: 10px;
background-color: #ffffff;
border-radius: 5px;
}
.page-style-item {
padding: 10px;
margin-top: 10px;
background-color: #ffffff;
border-radius: 5px;
}
.item-text {
flex-direction: row;
}
.item-text {
flex-direction: row;
}
.item-text-key {
font-weight: bold;
}
.item-text-key {
font-weight: bold;
}
.item-text-value {
margin-left: 5px;
}
.item-text-value {
margin-left: 5px;
}
.set-value {
margin-top: 10px;
}
.set-value {
margin-top: 10px;
}
.radio-set-value {
flex-direction: row;
}
.radio-set-value {
flex-direction: row;
}
.radio-value {
margin-left: 10px;
}
</style>
.radio-value {
margin-left: 10px;
}
</style>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录