Browse Source

修改mode

360BUYAD\wangyue92 7 years ago
parent
commit
de0254f7d1

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

@@ -23,7 +23,7 @@ describe('noticebar.vue',() => {
 
     it('通告栏模式--关闭模式',() => {
         wrapper.setProps({
-            mode:true
+            closeMode:true
         });
 
         return Vue.nextTick().then(function() {

+ 1 - 1
src/packages/noticebar/demo.vue

@@ -11,7 +11,7 @@
     ></nut-noticebar>
     <h4>通告栏模式--关闭模式</h4>
     <nut-noticebar
-      :mode="true"
+      :closeMode="true"
       @click="hello"
     >华为畅享9新品即将上市,活动期间0元预约可参与抽奖,赢HUAWEI WATCH等好礼,更多产品信息请持续关注!
     </nut-noticebar>

+ 1 - 1
src/packages/noticebar/doc.md

@@ -18,7 +18,7 @@
 ## 通告栏模式--关闭模式
 ```html
     <nut-noticebar
-      :mode="true"
+      :closeMode="true"
       @click="hello"
     >华为畅享9新品即将上市,活动期间0元预约可参与抽奖,赢HUAWEI WATCH等好礼,更多产品信息请持续关注!
     </nut-noticebar>

+ 4 - 4
src/packages/noticebar/noticebar.vue

@@ -2,7 +2,7 @@
   <div
     v-show="showNoticeBar"
     class="nut-noticebar"
-    :class="{ withicon: mode,close:mode }"
+    :class="{ withicon: closeMode,close:closeMode }"
     :style="barStyle"
     @click="$emit('click')"
   >
@@ -20,7 +20,7 @@
         <slot>{{ text }}</slot>
       </div>
     </div>
-    <div v-if="mode" class="right-icon"  @click="onClickIcon">
+    <div v-if="closeMode" class="right-icon"  @click="onClickIcon">
       <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30">
         <g fill-rule="evenodd">
           <path
@@ -37,7 +37,7 @@ export default {
   name: "nut-noticebar",
   props: {
     text: String,
-    mode: {
+    closeMode: {
       type: Boolean,
       default: false
     },
@@ -125,7 +125,7 @@ export default {
   },
   methods: {
     onClickIcon() {
-      this.showNoticeBar = !this.mode;
+      this.showNoticeBar = !this.closeMode;
     },
     onAnimationEnd() {
       this.firstRound = false;