Skip to content

Commit e66254d

Browse files
authored
Merge pull request #276 from heweishui/hybrid
harmony-hybrid文档增加一个FAQ
2 parents 2061d54 + 8000be8 commit e66254d

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

docs/harmony-hybrid/index.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,3 +1210,25 @@ window.navigationHeight
12101210
当存在原生导航栏时,fixed布局需要添加一个top值,其值为window.navigationHeight
12111211

12121212
[Web调试devtools配置]: https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/web/web-debugging-with-devtools.md
1213+
1214+
### 页面跳转后发现顶部多了一个css样式
1215+
1216+
**F:** 在打开Taro项目后,从pageA页面跳转到其他页面 ,发现跳转后页面增加了一个css样式,影响了页面的顶部布局样式。css设置示例如下:
1217+
1218+
```css
1219+
.taro_router .taro_page.taro_navigation_page{
1220+
   padding-top:100px;
1221+
}
1222+
```
1223+
1224+
**Q:** 这个问题是由taro的router机制造成;在pageA的index.scss中为`.taro_router .taro_page.taro_navigation_page`选择器设置某些样式后,当pageA页面被触发加载一次后,该样式生效并作用于全局,成为一个全局样式,影响所有页面;
1225+
1226+
如果希望页面不受`.taro_router .taro_page.taro_navigation_page`选择器样式影响,可以在页面的配置文件index.config.js文件中将navigationStyle属性值设置为custom,这样配置后,该页面不在受到navigation公共样式的影响,示例如下:
1227+
1228+
```javascript
1229+
export default {
1230+
   navigationStyle:"custom"
1231+
}
1232+
```
1233+
1234+
不推荐使用`.taro_router .taro_page.taro_navigation_page`选择器设置样式

versioned_docs/version-3.x/harmony-hybrid/index.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,3 +1210,25 @@ window.navigationHeight
12101210
当存在原生导航栏时,fixed布局需要添加一个top值,其值为window.navigationHeight
12111211

12121212
[Web调试devtools配置]: https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/web/web-debugging-with-devtools.md
1213+
1214+
### 页面跳转后发现顶部多了一个css样式
1215+
1216+
**F:** 在打开Taro项目后,从pageA页面跳转到其他页面 ,发现跳转后页面增加了一个css样式,影响了页面的顶部布局样式。css设置示例如下:
1217+
1218+
```css
1219+
.taro_router .taro_page.taro_navigation_page{
1220+
   padding-top:100px;
1221+
}
1222+
```
1223+
1224+
**Q:** 这个问题是由taro的router机制造成;在pageA的index.scss中为`.taro_router .taro_page.taro_navigation_page`选择器设置某些样式后,当pageA页面被触发加载一次后,该样式生效并作用于全局,成为一个全局样式,影响所有页面;
1225+
1226+
如果希望页面不受`.taro_router .taro_page.taro_navigation_page`选择器样式影响,可以在页面的配置文件index.config.js文件中将navigationStyle属性值设置为custom,这样配置后,该页面不在受到navigation公共样式的影响,示例如下:
1227+
1228+
```javascript
1229+
export default {
1230+
   navigationStyle:"custom"
1231+
}
1232+
```
1233+
1234+
不推荐使用`.taro_router .taro_page.taro_navigation_page`选择器设置样式

0 commit comments

Comments
 (0)