Browse Source

Merge branch 'v4' of https://github.com/jdf2e/nutui into v4

richard1015 3 years ago
parent
commit
243701823a

+ 5 - 15
src/packages/__VUE/sidenavbar/index.taro.vue

@@ -10,7 +10,6 @@
 <script lang="ts">
 <script lang="ts">
 import { computed, onMounted, reactive, ref, toRefs, Ref } from 'vue';
 import { computed, onMounted, reactive, ref, toRefs, Ref } from 'vue';
 import { createComponent } from '@/packages/utils/create';
 import { createComponent } from '@/packages/utils/create';
-// import { createIntersectionObserver, IntersectionObserver } from '@tarojs/taro';
 const { componentName, create } = createComponent('side-navbar');
 const { componentName, create } = createComponent('side-navbar');
 export default /* @__PURE__ */ create({
 export default /* @__PURE__ */ create({
   props: {
   props: {
@@ -24,7 +23,6 @@ export default /* @__PURE__ */ create({
     const list = ref(null) as Ref;
     const list = ref(null) as Ref;
     const state = reactive({
     const state = reactive({
       count: 1
       count: 1
-      // observer: null as IntersectionObserver | null
     });
     });
 
 
     const classes = computed(() => {
     const classes = computed(() => {
@@ -37,9 +35,11 @@ export default /* @__PURE__ */ create({
     const setPaddingLeft = (nodeList: any, level: number = 1) => {
     const setPaddingLeft = (nodeList: any, level: number = 1) => {
       for (let i = 0; i < nodeList.length; i++) {
       for (let i = 0; i < nodeList.length; i++) {
         let item = nodeList[i];
         let item = nodeList[i];
-        item.children[0].style.paddingLeft = props.offset * level + 'px';
-        if (!item.className.includes('nut-side-navbar-item')) {
-          setPaddingLeft(Array.from(item.children[1].children), ++state.count);
+        if (item.children) {
+          item.children[0].style.paddingLeft = props.offset * level + 'px';
+          if (!item.className.includes('nut-side-navbar-item')) {
+            setPaddingLeft(Array.from(item.children[1].children), ++state.count);
+          }
         }
         }
       }
       }
       state.count--;
       state.count--;
@@ -59,16 +59,6 @@ export default /* @__PURE__ */ create({
 
 
     onMounted(() => {
     onMounted(() => {
       handleSlots();
       handleSlots();
-      // state.observer = createIntersectionObserver(proxy, {
-      //   thresholds: [1],
-      //   initialRatio: 1,
-      //   observeAll: true
-      // });
-
-      // state.observer.observe(list.value, () => {
-      //   state.count = 1;
-      //   handleSlots();
-      // });
     });
     });
 
 
     return {
     return {

+ 1 - 0
src/packages/__VUE/sticky/index.scss

@@ -1,5 +1,6 @@
 .nut-sticky {
 .nut-sticky {
   &--stickyed {
   &--stickyed {
+    display: flex;
     position: sticky;
     position: sticky;
   }
   }
   &--fixed {
   &--fixed {

+ 6 - 1
src/packages/__VUE/subsidenavbar/index.vue

@@ -7,7 +7,12 @@
         <ArrowUp2 v-else></ArrowUp2>
         <ArrowUp2 v-else></ArrowUp2>
       </span>
       </span>
     </view>
     </view>
-    <view class="nut-sub-side-navbar__list" :class="!direction ? 'nutFadeIn' : 'nutFadeOut'" :style="style">
+    <view
+      class="nut-sub-side-navbar__list"
+      :class="!direction ? 'nutFadeIn' : 'nutFadeOut'"
+      :style="style"
+      v-show="!direction"
+    >
       <slot></slot>
       <slot></slot>
     </view>
     </view>
   </view>
   </view>

+ 4 - 4
src/sites/mobile-taro/vue/src/basic/pages/icon/index.vue

@@ -44,8 +44,8 @@
 
 
     <nut-cell-group v-for="item in icons.style" :title="item.name" :key="item">
     <nut-cell-group v-for="item in icons.style" :title="item.name" :key="item">
       <nut-cell>
       <nut-cell>
-        <ul>
-          <li v-for="it in item.icons" :key="it">
+        <ul class="icon-ul">
+          <li v-for="it in item.icons" :key="it" class="icon-li">
             <IconFont
             <IconFont
               :name="it.name"
               :name="it.name"
               :class="`nut-icon-${it['animation-name']} nut-icon-${it['animation-time']}`"
               :class="`nut-icon-${it['animation-name']} nut-icon-${it['animation-time']}`"
@@ -75,10 +75,10 @@ export default {
     margin-right: 10px;
     margin-right: 10px;
   }
   }
 }
 }
-ul {
+.icon-ul {
   display: flex;
   display: flex;
   flex-wrap: wrap;
   flex-wrap: wrap;
-  li {
+  .icon-li {
     flex: 0 0 25%;
     flex: 0 0 25%;
     max-width: 25%;
     max-width: 25%;
     display: flex;
     display: flex;

+ 3 - 0
src/sites/mobile-taro/vue/src/layout/pages/sticky/index.vue

@@ -21,6 +21,9 @@ export default defineComponent({
 });
 });
 </script>
 </script>
 <style lang="scss">
 <style lang="scss">
+.sticky-demo {
+  overflow: auto !important;
+}
 .sticky-container {
 .sticky-container {
   width: 100%;
   width: 100%;
   height: 300px;
   height: 300px;