Browse Source

fix: card、skeleton、tabbar bug

richard1015 5 years ago
parent
commit
94ed01a6f5

+ 28 - 17
src/packages/card/card.scss

@@ -1,6 +1,5 @@
-
 @mixin nut-card-border {
 @mixin nut-card-border {
-	position: absolute;
+  position: absolute;
   top: 0;
   top: 0;
   right: 0;
   right: 0;
   left: 0;
   left: 0;
@@ -12,45 +11,58 @@
   content: ' ';
   content: ' ';
   display: block;
   display: block;
 }
 }
-.nut-card-container{
+.nut-card-container {
+  .card-title {
+    display: flex;
+    justify-content: space-between;
+    width: 100%;
+    .right {
+      flex: 1;
+      font-size: $font-size-body-normal;
+      font-weight: 600;
+    }
+    .left {
+      color: $text-black-4;
+    }
+  }
   background: #fff;
   background: #fff;
   border-radius: 4px;
   border-radius: 4px;
   margin: 15px;
   margin: 15px;
-  .nut-card-header{
+  .nut-card-header {
     padding: 12px;
     padding: 12px;
     color: $text-black-1;
     color: $text-black-1;
     font-size: $font-size-body-small;
     font-size: $font-size-body-small;
     line-height: 24px;
     line-height: 24px;
     display: flex;
     display: flex;
     justify-content: space-between;
     justify-content: space-between;
-    .nut-card-title{
+    .nut-card-title {
       flex: 1;
       flex: 1;
       font-size: $font-size-body-normal;
       font-size: $font-size-body-normal;
       font-weight: 600;
       font-weight: 600;
       text-align: justify;
       text-align: justify;
     }
     }
-    .nut-card-supply-title{ 
+    .nut-card-supply-title {
       color: $text-black-4;
       color: $text-black-4;
       margin-left: 12px;
       margin-left: 12px;
     }
     }
-    .nut-card-icon{
+    .nut-card-icon {
       margin-left: 12px;
       margin-left: 12px;
     }
     }
   }
   }
-  .switch-icon-class{
+  .switch-icon-class {
     display: flex;
     display: flex;
-    justify-content: space-between
+    justify-content: space-between;
   }
   }
-  .mut-card-content{
+  .mut-card-content {
     padding: 12px;
     padding: 12px;
     color: $text-black-2;
     color: $text-black-2;
     font-size: $font-size-body-small;
     font-size: $font-size-body-small;
     position: relative;
     position: relative;
-    &:before{
+    &:before {
       @include nut-card-border;
       @include nut-card-border;
     }
     }
   }
   }
-  .mut-card-bottom{
+  .mut-card-bottom {
     display: flex;
     display: flex;
     align-items: center;
     align-items: center;
     justify-content: flex-end;
     justify-content: flex-end;
@@ -59,15 +71,14 @@
     padding: 0 12px;
     padding: 0 12px;
     position: relative;
     position: relative;
 
 
-    &::before{
+    &::before {
       @include nut-card-border;
       @include nut-card-border;
-    }    button{
+    }
+    button {
       margin: 0 5px;
       margin: 0 5px;
     }
     }
   }
   }
 }
 }
-.full-content{
+.full-content {
   margin: 0px;
   margin: 0px;
 }
 }
-
-

+ 1 - 15
src/packages/card/demo.vue

@@ -70,18 +70,4 @@ export default {
 };
 };
 </script>
 </script>
 
 
-<style lang="scss" scoped>
-.card-title {
-  display: flex;
-  justify-content: space-between;
-  width: 100%;
-  .right {
-    flex: 1;
-    font-size: $font-size-body-normal;
-    font-weight: 600;
-  }
-  .left {
-    color: $text-black-4;
-  }
-}
-</style>
+<style lang="scss" scoped></style>

+ 2 - 16
src/packages/skeleton/index.js

@@ -3,26 +3,12 @@ import './skeleton.scss';
 
 
 const { skeletonCircle, skeletonSquare, skeletonRow, skeletonColumn } = skeleton;
 const { skeletonCircle, skeletonSquare, skeletonRow, skeletonColumn } = skeleton;
 
 
-skeleton.install = function(Vue) {
+skeleton.install = function (Vue) {
   Vue.component(skeleton.name, skeleton);
   Vue.component(skeleton.name, skeleton);
-};
-skeletonCircle.install = function(Vue) {
   Vue.component(skeletonCircle.name, skeletonCircle);
   Vue.component(skeletonCircle.name, skeletonCircle);
-};
-skeletonSquare.install = function(Vue) {
   Vue.component(skeletonSquare.name, skeletonSquare);
   Vue.component(skeletonSquare.name, skeletonSquare);
-};
-skeletonRow.install = function(Vue) {
   Vue.component(skeletonRow.name, skeletonRow);
   Vue.component(skeletonRow.name, skeletonRow);
-};
-skeletonColumn.install = function(Vue) {
   Vue.component(skeletonColumn.name, skeletonColumn);
   Vue.component(skeletonColumn.name, skeletonColumn);
 };
 };
 
 
-export default {
-  skeleton,
-  skeletonCircle,
-  skeletonSquare,
-  skeletonRow,
-  skeletonColumn
-};
+export default skeleton;

+ 2 - 8
src/packages/steps/index.js

@@ -3,15 +3,9 @@ import './steps.scss';
 
 
 const { Step } = Steps;
 const { Step } = Steps;
 
 
-Steps.install = function(Vue) {
+Steps.install = function (Vue) {
   Vue.component(Steps.name, Steps);
   Vue.component(Steps.name, Steps);
-};
-
-Step.install = function(Vue) {
   Vue.component(Step.name, Step);
   Vue.component(Step.name, Step);
 };
 };
 
 
-export default {
-  Steps,
-  Step
-};
+export default Steps;

+ 1 - 1
src/packages/tabbar/__test__/tabbar.spec.js

@@ -37,7 +37,7 @@ describe('Tabbar.vue', () => {
   it('页签位于页面底部', () => {
   it('页签位于页面底部', () => {
     wrapper.setProps({ bottom: true });
     wrapper.setProps({ bottom: true });
     return Vue.nextTick().then(function () {
     return Vue.nextTick().then(function () {
-      expect(wrapper.contains('.bottom')).toBe(true);
+      expect(wrapper.contains('.tabbar-bottom')).toBe(true);
     });
     });
   });
   });
 
 

+ 1 - 1
src/packages/tabbar/tabbar.scss

@@ -14,7 +14,7 @@
   }
   }
 }
 }
 
 
-.bottom {
+.tabbar-bottom {
   position: fixed;
   position: fixed;
   bottom: 0;
   bottom: 0;
   left: 0;
   left: 0;

+ 1 - 1
src/packages/tabbar/tabbar.vue

@@ -1,5 +1,5 @@
 <template>
 <template>
-  <div class="nut-tabbar" :class="{ bottom: bottom }">
+  <div class="nut-tabbar" :class="{ 'tabbar-bottom': bottom }">
     <a
     <a
       class="tabbar-nav"
       class="tabbar-nav"
       v-for="(value, index) in tabList"
       v-for="(value, index) in tabList"