From e77474de9ef341960f0ff5a2804050fec5f0f02a Mon Sep 17 00:00:00 2001
From: 梁灏 <admin@aresn.com>
Date: Wed, 20 Jun 2018 17:09:11 +0800
Subject: [PATCH] update

---
 src/components/cell/cell.vue | 16 ++++------------
 src/mixins/link.js           | 17 +++++++++++++++++
 2 files changed, 21 insertions(+), 12 deletions(-)
 create mode 100644 src/mixins/link.js

diff --git a/src/components/cell/cell.vue b/src/components/cell/cell.vue
index 2abdf72..36dfb0b 100644
--- a/src/components/cell/cell.vue
+++ b/src/components/cell/cell.vue
@@ -1,6 +1,6 @@
 <template>
     <div :class="classes" tabindex="0">
-        <a v-if="to" :href="to" class="ivu-cell-link" @click.prevent="handleClick">
+        <a v-if="to" :href="linkUrl" class="ivu-cell-link" @click.prevent="handleClick">
             <CellItem :title="title" :label="label" :extra="extra">
                 <slot name="icon" slot="icon"></slot>
                 <slot></slot>
@@ -24,11 +24,13 @@
 <script>
     import CellItem from './cell-item.vue';
     import Icon from '../icon/icon.vue';
+    import mixinsLink from '../../mixins/link';
 
     const prefixCls = 'ivu-cell';
 
     export default {
         name: 'Cell',
+        mixins: [ mixinsLink ],
         components: { CellItem, Icon },
         props: {
             name: {
@@ -77,17 +79,7 @@
                         [`${prefixCls}-with-link`]: this.to
                     }
                 ];
-            }
+            },
         },
-        methods: {
-            handleClick () {
-                const isRoute = this.$router;
-                if (isRoute) {
-                    this.replace ? this.$router.replace(this.to) : this.$router.push(this.to);
-                } else {
-                    window.location.href = this.to;
-                }
-            }
-        }
     }
 </script>
\ No newline at end of file
diff --git a/src/mixins/link.js b/src/mixins/link.js
new file mode 100644
index 0000000..bb5a300
--- /dev/null
+++ b/src/mixins/link.js
@@ -0,0 +1,17 @@
+export default {
+    computed: {
+        linkUrl () {
+
+        }
+    },
+    methods: {
+        handleClick () {
+            const isRoute = this.$router;
+            if (isRoute) {
+                this.replace ? this.$router.replace(this.to) : this.$router.push(this.to);
+            } else {
+                window.location.href = this.to;
+            }
+        }
+    }
+}
\ No newline at end of file
--
libgit2 0.21.4