diff --git a/pages.config.ts b/pages.config.ts
index f73172d..7fec6d8 100644
--- a/pages.config.ts
+++ b/pages.config.ts
@@ -6,6 +6,7 @@ export default defineUniPages({
navigationBarTitleText: 'vue3-uniapp',
navigationBarBackgroundColor: '#f8f8f8',
navigationBarTextStyle: 'black',
+ backgroundColor: '#FFFFFF',
},
easycom: {
autoscan: true,
diff --git a/src/pages.json b/src/pages.json
index b12c80d..a038f6e 100644
--- a/src/pages.json
+++ b/src/pages.json
@@ -3,7 +3,8 @@
"navigationStyle": "default",
"navigationBarTitleText": "vue3-uniapp",
"navigationBarBackgroundColor": "#f8f8f8",
- "navigationBarTextStyle": "black"
+ "navigationBarTextStyle": "black",
+ "backgroundColor": "#FFFFFF"
},
"easycom": {
"autoscan": true,
@@ -62,7 +63,31 @@
"navigationBarTitleText": "通屏+下拉刷新+自定义导航栏",
"enablePullDownRefresh": true,
"backgroundColor": "#23c09c",
- "navigationStyle": "custom"
+ "app-plus": {
+ "titleNView": {
+ "type": "transparent"
+ }
+ },
+ "mp-weixin": {
+ "navigationStyle": "custom"
+ }
+ }
+ },
+ {
+ "path": "pages/throughout2/index",
+ "type": "page",
+ "style": {
+ "navigationBarTitleText": "通屏+下拉刷新+自定义导航栏",
+ "enablePullDownRefresh": false,
+ "backgroundColor": "#23c09c",
+ "app-plus": {
+ "titleNView": {
+ "type": "transparent"
+ }
+ },
+ "mp-weixin": {
+ "navigationStyle": "custom"
+ }
}
}
],
diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue
index 96541ab..106acd7 100644
--- a/src/pages/index/index.vue
+++ b/src/pages/index/index.vue
@@ -19,6 +19,9 @@
Demo Count: {{ countStore.count }}
+
+ 这是一个基础卡片示例,内容较少,此示例展示了一个没有任何属性不带阴影的卡片。
+
diff --git a/src/pages/throughout/index.vue b/src/pages/throughout/index.vue
index 6776d5e..b4d617f 100644
--- a/src/pages/throughout/index.vue
+++ b/src/pages/throughout/index.vue
@@ -4,16 +4,24 @@
navigationBarTitleText: '通屏+下拉刷新+自定义导航栏',
enablePullDownRefresh: true,
backgroundColor: '#23c09c', // 这个背景色要与页面的.top-section的背景图差不多,这样下拉刷新看起来才比较协调
- navigationStyle: 'custom',
+ 'app-plus': {
+ titleNView: {
+ type: 'transparent',
+ },
+ },
+ 'mp-weixin': {
+ navigationStyle: 'custom',
+ },
},
}
+
-
+
@@ -23,11 +31,12 @@
url="/pages/index/index"
class="left-icon"
>
-
+
{{ '我是标题' }}
+
+
+
+
@@ -87,7 +99,15 @@ const onRefresherRefresh = async () => {
page {
display: flex;
flex-direction: column;
+
+ // #ifdef MP-WEIXIN
height: 100%;
+
+ // #endif
+ // #ifndef MP-WEIXIN
+ min-height: 100%;
+
+ // #endif
overflow: hidden;
}
diff --git a/src/pages/throughout2/index.vue b/src/pages/throughout2/index.vue
new file mode 100644
index 0000000..a95a9f8
--- /dev/null
+++ b/src/pages/throughout2/index.vue
@@ -0,0 +1,160 @@
+
+{
+ style: {
+ navigationBarTitleText: '通屏+下拉刷新+自定义导航栏',
+ enablePullDownRefresh: false,
+ backgroundColor: '#23c09c', // 这个背景色要与页面的.top-section的背景图差不多,这样下拉刷新看起来才比较协调
+ 'app-plus': {
+ titleNView: {
+ type: 'transparent',
+ },
+ },
+ 'mp-weixin': {
+ navigationStyle: 'custom',
+ },
+ },
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ '我是标题' }}
+
+
+
+
+
+ 顶部区域
+ 可以是标题,也可以是个人中心头像等
+ 建议本区域高度不低于200rpx
+
+
+ 注意,上面的导航栏渐变效果仅微信端支持,且上面的导航栏无法抽为组件引入使用,否则滚动效果没有了。如果不只是微信小程序使用,可以
+ onPageScroll 实现全端效果一样,另外如果是app端,还可以配置 titleNView。参考
+ https://uniapp.dcloud.net.cn/tutorial/page.html#onpagescroll 。
+
+
+
+
+
+
+
+
+
+
diff --git a/uni-pages.d.ts b/uni-pages.d.ts
index 6cfba54..f5f05ec 100644
--- a/uni-pages.d.ts
+++ b/uni-pages.d.ts
@@ -7,19 +7,20 @@ interface NavigateToOptions {
url: "pages/index/index" |
"pages/demo/index" |
"pages/my/index" |
- "pages/throughout/index";
+ "pages/throughout/index" |
+ "pages/throughout2/index";
}
interface RedirectToOptions extends NavigateToOptions {}
interface SwitchTabOptions {
- url: 'pages/index/index' | 'pages/throughout/index'
+ url: "pages/index/index" | "pages/throughout/index"
}
-type ReLaunchOptions = NavigateToOptions | SwitchTabOptions
+type ReLaunchOptions = NavigateToOptions | SwitchTabOptions;
declare interface Uni {
- navigateTo(options: UniNamespace.NavigateToOptions & NavigateToOptions): void
- redirectTo(options: UniNamespace.RedirectToOptions & RedirectToOptions): void
- switchTab(options: UniNamespace.SwitchTabOptions & SwitchTabOptions): void
- reLaunch(options: UniNamespace.ReLaunchOptions & ReLaunchOptions): void
+ navigateTo(options: UniNamespace.NavigateToOptions & NavigateToOptions): void;
+ redirectTo(options: UniNamespace.RedirectToOptions & RedirectToOptions): void;
+ switchTab(options: UniNamespace.SwitchTabOptions & SwitchTabOptions): void;
+ reLaunch(options: UniNamespace.ReLaunchOptions & ReLaunchOptions): void;
}