Skip to content

Commit ad7075c

Browse files
committed
Merge branch 'master' into dev
2 parents c0bee41 + 1b0d63f commit ad7075c

1 file changed

Lines changed: 27 additions & 25 deletions

File tree

‎pages/component/view/view.vue‎

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
<page-head title="view"></page-head>
44
<view class="uni-padding-wrap uni-common-mt">
55
<view class="uni-hello-text">
6-
Flex是Flexible Box的缩写,意为“弹性布局”,用来为盒状模型提供最大的灵活性。当设置display: flex后,继续给view等容器组件设置flex-direction: row或column,就可以在该容器内按行或列排布子组件。uni-app默认全局使用flex布局(在App.vue里预设了)。因为flex布局有利于跨更多平台,尤其是采用原生渲染的平台。
6+
Flex是Flexible Box的缩写,意为“弹性布局”,用来为盒状模型提供最大的灵活性。当设置display: flex后,继续给view等容器组件设置flex-direction:
7+
row或column,就可以在该容器内按行或列排布子组件。uni-app默认全局使用flex布局(在App.vue里预设了)。因为flex布局有利于跨更多平台,尤其是采用原生渲染的平台。
78
</view>
8-
9+
910
<view class="uni-title uni-common-mt">
1011
flex-direction: row
1112
<text>\n横向布局</text>
@@ -15,7 +16,7 @@
1516
<view class="flex-item uni-bg-green">B</view>
1617
<view class="flex-item uni-bg-blue">C</view>
1718
</view>
18-
19+
1920
<view class="uni-title uni-common-mt">
2021
flex-direction: column
2122
<text>\n纵向布局</text>
@@ -25,7 +26,7 @@
2526
<view class="flex-item flex-item-V uni-bg-green">B</view>
2627
<view class="flex-item flex-item-V uni-bg-blue">C</view>
2728
</view>
28-
29+
2930
<view class="uni-title uni-common-mt">
3031
更多布局示例
3132
<text>\nflex布局演示</text>
@@ -37,29 +38,29 @@
3738
<view class="text">横向布局-自动宽度</view>
3839
<view class="text">横向布局-自动宽度</view>
3940
</view>
40-
<view class="uni-flex uni-row" style="justify-content: center;">
41+
<view class="uni-flex uni-row" style="-webkit-justify-content: center;justify-content: center;">
4142
<view class="text">横向布局-居中</view>
4243
<view class="text">横向布局-居中</view>
4344
</view>
44-
<view class="uni-flex uni-row" style="justify-content: flex-end;">
45+
<view class="uni-flex uni-row" style="-webkit-justify-content: flex-end;justify-content: flex-end;">
4546
<view class="text">横向布局-居右</view>
4647
<view class="text">横向布局-居右</view>
4748
</view>
4849
<view class="uni-flex uni-row">
49-
<view class="text" style="flex: 1;">横向布局-平均分布</view>
50-
<view class="text" style="flex: 1;">横向布局-平均分布</view>
50+
<view class="text" style="-webkit-flex: 1;flex: 1;">横向布局-平均分布</view>
51+
<view class="text" style="-webkit-flex: 1;flex: 1;">横向布局-平均分布</view>
5152
</view>
52-
<view class="uni-flex uni-row" style="justify-content: space-between;">
53+
<view class="uni-flex uni-row" style="-webkit-justify-content: space-between;justify-content: space-between;">
5354
<view class="text">横向布局-两端对齐</view>
5455
<view class="text">横向布局-两端对齐</view>
5556
</view>
5657
<view class="uni-flex uni-row">
5758
<view class="text" style="width: 200upx;">固定宽度</view>
58-
<view class="text" style="flex: 1;">自动占满余量</view>
59+
<view class="text" style="-webkit-flex: 1;flex: 1;">自动占满余量</view>
5960
</view>
6061
<view class="uni-flex uni-row">
6162
<view class="text" style="width: 200upx;">固定宽度</view>
62-
<view class="text" style="flex: 1;">自动占满</view>
63+
<view class="text" style="-webkit-flex: 1;flex: 1;">自动占满</view>
6364
<view class="text" style="width: 200upx;">固定宽度</view>
6465
</view>
6566
<view class="uni-flex uni-row" style="-webkit-flex-wrap: wrap;flex-wrap: wrap;">
@@ -68,33 +69,33 @@
6869
<view class="text" style="width: 280upx;">一行显示不全,wrap折行</view>
6970
</view>
7071
<view class="uni-flex uni-row">
71-
<view class="text" style="flex: 1;height: 200upx;display: flex; justify-content: center;align-items: flex-start;">
72+
<view class="text uni-flex" style="-webkit-flex: 1;flex: 1;height: 200upx;-webkit-justify-content: center;justify-content: center;-webkit-align-items: flex-start;align-items: flex-start;">
7273
<text>垂直居顶</text>
7374
</view>
74-
<view class="text" style="flex: 1;height: 200upx;display: flex; justify-content: center;align-items: center;">
75+
<view class="text uni-flex" style="-webkit-flex: 1;flex: 1;height: 200upx;-webkit-justify-content: center;justify-content: center;-webkit-align-items: center;align-items: center;">
7576
<text>垂直居中</text>
7677
</view>
77-
<view class="text" style="flex: 1;height: 200upx;display: flex; justify-content: center;align-items: flex-end;">
78+
<view class="text uni-flex" style="-webkit-flex: 1;flex: 1;height: 200upx;-webkit-justify-content: center;justify-content: center;-webkit-align-items: flex-end;align-items: flex-end;">
7879
<text>垂直居底</text>
7980
</view>
8081
</view>
8182
</view>
82-
83+
8384
<view class="uni-title uni-common-mt">
8485
组合示例
8586
<text>\nflex布局演示</text>
8687
</view>
8788
<view class="uni-flex uni-row">
88-
<view class="text" style="width: 200upx;height: 220upx;display: flex; justify-content: center;align-items: center;">
89+
<view class="text" style="width: 200upx;height: 220upx;display: -webkit-flex;display: flex; -webkit-justify-content: center;justify-content: center;-webkit-align-items: center;align-items: center;">
8990
<image src="../../../static/plus.png" style="width: 150upx;height: 150upx;"></image>
9091
</view>
91-
<view class="uni-flex uni-column" style="flex: 1;justify-content: space-between;">
92+
<view class="uni-flex uni-column" style="-webkit-flex: 1;flex: 1;-webkit-justify-content: space-between;justify-content: space-between;">
9293
<view class="text" style="height: 120upx;text-align: left;padding-left: 20upx;padding-top: 10upx;">
9394
文字居左,留出左间距
9495
</view>
9596
<view class="uni-flex uni-row">
96-
<view class="text" style="flex: 1;">剩余数量</view>
97-
<view class="text" style="flex: 1;">立即购买</view>
97+
<view class="text" style="-webkit-flex: 1;flex: 1;">剩余数量</view>
98+
<view class="text" style="-webkit-flex: 1;flex: 1;">立即购买</view>
9899
</view>
99100
</view>
100101
</view>
@@ -104,8 +105,7 @@
104105
<script>
105106
export default {
106107
data() {
107-
return {
108-
}
108+
return {}
109109
}
110110
}
111111
</script>
@@ -124,8 +124,9 @@
124124
text-align: center;
125125
line-height: 150upx;
126126
}
127-
.text{
128-
margin:15upx 10upx;
127+
128+
.text {
129+
margin: 15upx 10upx;
129130
padding: 0 20upx;
130131
background-color: #ebebeb;
131132
height: 70upx;
@@ -134,7 +135,8 @@
134135
color: #777;
135136
font-size: 26upx;
136137
}
137-
.desc{
138+
139+
.desc {
138140
/* text-indent: 40upx; */
139141
}
140-
</style>
142+
</style>

0 commit comments

Comments
 (0)