Explorar o código

Pagination: fix icon style, fixed #163

qingwei.li %!s(int64=8) %!d(string=hai) anos
pai
achega
7964857996
Modificáronse 2 ficheiros con 13 adicións e 4 borrados
  1. 1 0
      CHANGELOG.md
  2. 12 4
      packages/pagination/src/pager.vue

+ 1 - 0
CHANGELOG.md

@@ -9,6 +9,7 @@
 - 新增特性 Menu 组件中若选中子菜单项现在会自动展开所有父级菜单
 - 修复 vue-popper 引入 popper 路径错误
 - 修复 DatePicker 初始值是合法时间类型但无法设置成功的问题
+- 修复 Pagination 的图标没有正确切换样式, #163
 
 #### 非兼容性更新
 - Menu 组件的 `unique-opend` 属性修正为 `unique-opened`

+ 12 - 4
packages/pagination/src/pager.vue

@@ -9,8 +9,7 @@
       :class="[quickprevIconClass]"
       v-if="showPrevMore"
       @mouseenter="quickprevIconClass = 'el-icon-d-arrow-left'"
-      @mouseleave="quickprevIconClass = 'el-icon-more'"
-    >
+      @mouseleave="quickprevIconClass = 'el-icon-more'">
     </li>
     <li
       v-for="pager in pagers"
@@ -21,8 +20,7 @@
       :class="[quicknextIconClass]"
       v-if="showNextMore"
       @mouseenter="quicknextIconClass = 'el-icon-d-arrow-right'"
-      @mouseleave="quicknextIconClass = 'el-icon-more'"
-    >
+      @mouseleave="quicknextIconClass = 'el-icon-more'">
     </li>
     <li
       :class="{ active: currentPage === pageCount }"
@@ -41,6 +39,16 @@
       pageCount: Number
     },
 
+    watch: {
+      showPrevMore(val) {
+        if (!val) this.quickprevIconClass = 'el-icon-more';
+      },
+
+      showNextMore(val) {
+        if (!val) this.quicknextIconClass = 'el-icon-more';
+      }
+    },
+
     methods: {
       onPagerClick(event) {
         const target = event.target;