Browse Source

fix: view-block warn

richard1015 4 years ago
parent
commit
b5cfe727e9

+ 23 - 23
src/packages/__VUE/address/index.taro.vue

@@ -7,29 +7,29 @@
     v-model:visible="showPopup"
     :class="classes"
   >
-    <view-block class="nut-address">
-      <view-block class="nut-address__header">
-        <view-block class="arrow-back" @click="switchModule">
+    <view class="nut-address">
+      <view class="nut-address__header">
+        <view class="arrow-back" @click="switchModule">
           <nut-icon
             :name="backBtnIcon"
             color="#cccccc"
             v-if="privateType == 'custom' && type == 'exist' && backBtnIcon"
           ></nut-icon>
-        </view-block>
+        </view>
 
-        <view-block class="nut-address__header__title">
+        <view class="nut-address__header__title">
           {{ privateType == 'custom' ? customAddressTitle : existAddressTitle }}
-        </view-block>
+        </view>
 
-        <view-block class="arrow-close" @click="handClose('cross')">
+        <view class="arrow-close" @click="handClose('cross')">
           <nut-icon v-if="closeBtnIcon" :name="closeBtnIcon" color="#cccccc" size="18px"></nut-icon>
-        </view-block>
-      </view-block>
+        </view>
+      </view>
 
       <!-- 请选择 -->
-      <view-block class="custom-address" v-if="privateType == 'custom'">
-        <view-block class="region-tab">
-          <view-block
+      <view class="custom-address" v-if="privateType == 'custom'">
+        <view class="region-tab">
+          <view
             class="tab-item"
             :class="[index == tabIndex ? 'active' : '', key]"
             v-for="(item, key, index) in selectedRegion"
@@ -38,12 +38,12 @@
             @click="changeRegionTab(item, key, index)"
           >
             <view>{{ getTabName(item, index) }}</view>
-          </view-block>
+          </view>
 
-          <view-block class="region-tab-line" ref="regionLine" :style="{ left: lineDistance + 'px' }"></view-block>
-        </view-block>
+          <view class="region-tab-line" ref="regionLine" :style="{ left: lineDistance + 'px' }"></view>
+        </view>
 
-        <view-block class="region-con">
+        <view class="region-con">
           <ul class="region-group">
             <li
               v-for="(item, index) in regionList[tabName[tabIndex]]"
@@ -63,10 +63,10 @@
               >{{ item.name }}
             </li>
           </ul>
-        </view-block>
-      </view-block>
+        </view>
+      </view>
 
-      <view-block class="custom-address" v-else-if="privateType === 'custom2'">
+      <view class="custom-address" v-else-if="privateType === 'custom2'">
         <view class="region-tab">
           <view
             class="tab-item"
@@ -87,10 +87,10 @@
             @click-item="handleElevatorItem"
           ></nut-elevator>
         </view>
-      </view-block>
+      </view>
 
       <!-- 配送至 -->
-      <view-block class="exist-address" v-else-if="privateType == 'exist'">
+      <view class="exist-address" v-else-if="privateType == 'exist'">
         <div class="exist-address-group">
           <ul class="exist-ul">
             <li
@@ -125,8 +125,8 @@
         <div class="choose-other" @click="switchModule" v-if="isShowCustomAddress">
           <div class="btn">{{ customAndExistTitle }}</div>
         </div>
-      </view-block>
-    </view-block>
+      </view>
+    </view>
   </nut-popup>
 </template>
 <script lang="ts">

+ 1 - 0
src/packages/__VUE/infiniteloading/demo.vue

@@ -136,6 +136,7 @@ export default createDemo({
   height: 300px;
   width: 100%;
   padding: 0;
+  margin: 0;
   overflow-y: auto;
   overflow-x: hidden;
 }

+ 18 - 26
src/packages/__VUE/infiniteloading/index.taro.vue

@@ -10,28 +10,28 @@
     @touchmove="touchMove"
     @touchend="touchEnd"
   >
-    <view-block class="nut-infinite-top" :style="getStyle">
-      <view-block class="top-box" id="refreshTop">
+    <view class="nut-infinite-top" :style="getStyle">
+      <view class="top-box" id="refreshTop">
         <nut-icon class="top-img" :name="pullIcon"></nut-icon>
-        <view-block class="top-text">{{ pullTxt }}</view-block>
-      </view-block>
-    </view-block>
+        <view class="top-text">{{ pullTxt }}</view>
+      </view>
+    </view>
 
-    <view-block class="nut-infinite-container">
+    <view class="nut-infinite-container">
       <slot></slot>
-    </view-block>
+    </view>
 
-    <view-block class="nut-infinite-bottom">
+    <view class="nut-infinite-bottom">
       <template v-if="isInfiniting">
-        <view-block class="bottom-box">
+        <view class="bottom-box">
           <nut-icon class="bottom-img" :name="loadIcon"></nut-icon>
-          <view-block class="bottom-text">{{ loadTxt }}</view-block>
-        </view-block>
+          <view class="bottom-text">{{ loadTxt }}</view>
+        </view>
       </template>
       <template v-else-if="!hasMore">
-        <view-block class="tips">{{ loadMoreTxt }}</view-block>
+        <view class="tips">{{ loadMoreTxt }}</view>
       </template>
-    </view-block>
+    </view>
   </scroll-view>
 </template>
 <script lang="ts">
@@ -52,8 +52,7 @@ export default create({
     },
     pullIcon: {
       type: String,
-      default:
-        'https://img10.360buyimg.com/imagetools/jfs/t1/169863/6/4565/6306/60125948E7e92774e/40b3a0cf42852bcb.png'
+      default: 'https://img10.360buyimg.com/imagetools/jfs/t1/169863/6/4565/6306/60125948E7e92774e/40b3a0cf42852bcb.png'
     },
     pullTxt: {
       type: String,
@@ -61,8 +60,7 @@ export default create({
     },
     loadIcon: {
       type: String,
-      default:
-        'https://img10.360buyimg.com/imagetools/jfs/t1/169863/6/4565/6306/60125948E7e92774e/40b3a0cf42852bcb.png'
+      default: 'https://img10.360buyimg.com/imagetools/jfs/t1/169863/6/4565/6306/60125948E7e92774e/40b3a0cf42852bcb.png'
     },
     loadTxt: {
       type: String,
@@ -123,9 +121,7 @@ export default create({
       };
     });
     const getParentElement = (el) => {
-      return Taro.createSelectorQuery().select(
-        !!props.containerId ? `#${props.containerId} #${el}` : `#${el}`
-      );
+      return Taro.createSelectorQuery().select(!!props.containerId ? `#${props.containerId} #${el}` : `#${el}`);
     };
     /** 获取需要滚动的距离 */
     const getScrollHeight = () => {
@@ -157,10 +153,7 @@ export default create({
         // 滚动到最底部
         e.detail.scrollTop = state.scrollHeight;
       }
-      if (
-        e.detail.scrollTop > state.scrollTop ||
-        e.detail.scrollTop >= state.scrollHeight
-      ) {
+      if (e.detail.scrollTop > state.scrollTop || e.detail.scrollTop >= state.scrollHeight) {
         state.direction = 'down';
       } else {
         state.direction = 'up';
@@ -191,8 +184,7 @@ export default create({
 
       if (state.distance > 0 && state.isTouching) {
         event.preventDefault();
-        if (state.distance >= state.refreshMaxH)
-          state.distance = state.refreshMaxH;
+        if (state.distance >= state.refreshMaxH) state.distance = state.refreshMaxH;
       } else {
         state.distance = 0;
         state.isTouching = false;

+ 5 - 8
src/sites/mobile-taro/vue/src/feedback/pages/infiniteloading/index.vue

@@ -2,7 +2,7 @@
   <view class="demo">
     <h2>基础演示</h2>
     <nut-cell>
-      <view-block class="infiniteUl" id="scrollDemo">
+      <view class="infiniteUl" id="scrollDemo">
         <nut-infiniteloading
           pull-icon="JD"
           load-txt="loading"
@@ -13,14 +13,9 @@
           @load-more="loadMore"
           @refresh="refresh"
         >
-          <view-block
-            class="infiniteLi"
-            v-for="(item, index) in defultList"
-            :key="index"
-            >{{ item }}</view-block
-          >
+          <view class="infiniteLi" v-for="(item, index) in defultList" :key="index">{{ item }}</view>
         </nut-infiniteloading>
-      </view-block>
+      </view>
     </nut-cell>
   </view>
 </template>
@@ -81,6 +76,8 @@ export default {
 .infiniteUl {
   height: 500px;
   width: 100%;
+  padding: 0;
+  margin: 0;
   overflow-y: auto;
   overflow-x: hidden;
 }