Kaynağa Gözat

修改两个选项样式

xiaohaizhao 9 ay önce
ebeveyn
işleme
586be083e1
2 değiştirilmiş dosya ile 20 ekleme ve 2 silme
  1. 18 0
      components/Yl_nav/index.scss
  2. 2 2
      components/Yl_nav/index.wxml

+ 18 - 0
components/Yl_nav/index.scss

@@ -32,6 +32,24 @@
         }
     }
 
+    .special {
+        justify-content: space-between;
+
+        .item {
+            width: auto;
+        }
+
+        .special0 {
+            text-align: left;
+            padding: 0 20rpx;
+        }
+
+        .special1 {
+            text-align: right;
+            padding-left: 20rpx;
+        }
+    }
+
     .search {
         width: 90rpx;
         height: 90rpx;

+ 2 - 2
components/Yl_nav/index.wxml

@@ -1,6 +1,6 @@
 <view class="Yl_nav_box">
-    <view class="mian">
-        <navigator class="item" url="#" wx:for="{{list}}" wx:key="index" style="width: {{item.width}};" bindtap="onClick" data-item="{{item}}">
+    <view class="mian {{list.length == 2?'special':''}}">
+        <navigator class="item {{'special'+index}}" url="#" wx:for="{{list}}" wx:key="index" style="width: {{item.width}};" bindtap="onClick" data-item="{{item}}">
             <text class="iconfont {{item.icon}}" style="color: {{item.color}};" />
             <text class="label">{{language[item.label]||item.label}}</text>
         </navigator>