Skip to content

Commit 6da64e2

Browse files
committed
nvue样式调整
1 parent a32cd0f commit 6da64e2

File tree

12 files changed

+37
-15
lines changed

12 files changed

+37
-15
lines changed

components/page-nav/page-nav.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
</script>
4747

4848
<style lang="scss" scoped>
49+
@import "@/uview-ui/libs/css/style.components.scss";
4950
.nav-wrap {
5051
padding: 30rpx;
5152
position: relative;
@@ -58,7 +59,8 @@
5859
}
5960
6061
.nav-title {
61-
display: flex;
62+
@include vue-flex;
63+
flex-direction: row;
6264
align-items: center;
6365
}
6466
@@ -67,7 +69,7 @@
6769
}
6870
6971
.nav-title__text {
70-
display: flex;
72+
@include vue-flex;
7173
color: $u-main-color;
7274
font-size: 50rpx;
7375
font-weight: bold;
@@ -87,6 +89,6 @@
8789
.nav-desc {
8890
margin-top: 20rpx;
8991
font-size: 28rpx;
90-
color: $u-content-color;
92+
color: $u-content-color;
9193
}
9294
</style>

manifest.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
"versionCode" : "100",
77
"transformPx" : false,
88
"app-plus" : {
9+
// 定义nvue页面的flex布局默认为row排列
10+
"nvue ": {
11+
"flex-direction": "row"
12+
},
913
// APP-VUE分包,可提APP升启动速度,2.7.12开始支持,兼容微信小程序分包方案,默认关闭
1014
"optimization" : {
1115
"subPackages" : true
File renamed without changes.
File renamed without changes.

uview-ui/components/u-cell-group/u-cell-group.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,6 @@
6565
6666
.u-cell-item-box {
6767
background-color: #FFFFFF;
68+
flex-direction: center;
6869
}
6970
</style>

uview-ui/components/u-cell-item/u-cell-item.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,9 @@ export default {
211211
<style lang="scss" scoped>
212212
@import "../../libs/css/style.components.scss";
213213
.u-cell {
214+
@include vue-flex;
215+
align-items: center;
214216
position: relative;
215-
display: flex;
216217
box-sizing: border-box;
217218
width: 100%;
218219
padding: 26rpx 32rpx;

uview-ui/components/u-dropdown/u-dropdown.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,14 +181,14 @@
181181
width: 100%;
182182
183183
&__menu {
184-
display: flex;
184+
@include vue-flex;
185185
position: relative;
186186
z-index: 11;
187187
height: 80rpx;
188188
189189
&__item {
190190
flex: 1;
191-
display: flex;
191+
@include vue-flex;
192192
justify-content: center;
193193
align-items: center;
194194
@@ -201,7 +201,7 @@
201201
margin-left: 6rpx;
202202
transition: transform .3s;
203203
align-items: center;
204-
display: flex;
204+
@include vue-flex;
205205
206206
&--rotate {
207207
transform: rotate(180deg);

uview-ui/components/u-icon/u-icon.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,10 @@ export default {
203203
@import '../../iconfont.css';
204204
205205
.u-icon {
206+
/* #ifndef APP-NVUE */
206207
display: inline-flex;
208+
/* #endif */
209+
flex-direction: row;
207210
align-items: center;
208211
209212
&--left {
@@ -251,8 +254,10 @@ export default {
251254
}
252255
253256
&__img {
257+
/* #ifndef APP-PLUS */
254258
height: auto;
255259
will-change: transform;
260+
/* #endif */
256261
}
257262
258263
&__label {

uview-ui/components/u-tabbar/u-tabbar.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,14 +230,15 @@
230230
</script>
231231

232232
<style scoped lang="scss">
233+
@import "../../libs/css/style.components.scss";
233234
.u-fixed-placeholder {
234235
box-sizing: content-box;
235236
}
236237
237238
.u-tabbar {
238239
239240
&__content {
240-
display: flex;
241+
@include vue-flex;
241242
align-items: center;
242243
position: relative;
243244
position: fixed;
@@ -277,7 +278,7 @@
277278
278279
&__button {
279280
position: absolute;
280-
top: 10rpx;
281+
top: 14rpx;
281282
left: 50%;
282283
transform: translateX(-50%);
283284
}
@@ -287,7 +288,7 @@
287288
font-size: 26rpx;
288289
line-height: 28rpx;
289290
position: absolute;
290-
bottom: 12rpx;
291+
bottom: 14rpx;
291292
left: 50%;
292293
transform: translateX(-50%);
293294
}

uview-ui/libs/css/common.scss

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ text {
4545
/* #ifndef APP-NVUE */
4646
display: flex;
4747
/* #endif */
48-
flex-direction: row;
48+
flex-direction: row!important;
4949
align-items: center;
5050
}
5151

@@ -169,4 +169,8 @@ text {
169169
}
170170
}
171171

172-
172+
// 重置nvue的默认关于flex的样式
173+
.u-reset-nvue {
174+
flex-direction: row;
175+
align-items: center;
176+
}
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
.demo {
2-
1+
// 定义混入指令,用于在非nvue环境下的flex定义,因为nvue没有display属性,会报错
2+
@mixin vue-flex($direction: row) {
3+
/* #ifndef APP-NVUE */
4+
display: flex;
5+
flex-direction: $direction;
6+
/* #endif */
37
}

vue.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ module.exports = {
66
disableHostCheck: true
77
}
88
},
9-
//productionSourceMap: false
9+
//productionSourceMap: false,
1010
}

0 commit comments

Comments
 (0)