Browse Source

refine code

Pan 6 years ago
parent
commit
b74ab40e2a
2 changed files with 3 additions and 6 deletions
  1. 1 1
      src/components/SvgIcon/index.vue
  2. 2 5
      src/views/layout/components/Sidebar/Link.vue

+ 1 - 1
src/components/SvgIcon/index.vue

@@ -1,5 +1,5 @@
1 1
 <template>
2
-  <svg :class="svgClass" aria-hidden="true">
2
+  <svg :class="svgClass" aria-hidden="true" v-on="$listeners">
3 3
     <use :xlink:href="iconName"/>
4 4
   </svg>
5 5
 </template>

+ 2 - 5
src/views/layout/components/Sidebar/Link.vue

@@ -1,6 +1,6 @@
1 1
 
2 2
 <template>
3
-  <!-- eslint-disable vue/require-component-is-->
3
+  <!-- eslint-disable vue/require-component-is -->
4 4
   <component v-bind="linkProps(to)">
5 5
     <slot/>
6 6
   </component>
@@ -17,11 +17,8 @@ export default {
17 17
     }
18 18
   },
19 19
   methods: {
20
-    isExternalLink(routePath) {
21
-      return isExternal(routePath)
22
-    },
23 20
     linkProps(url) {
24
-      if (this.isExternalLink(url)) {
21
+      if (isExternal(url)) {
25 22
         return {
26 23
           is: 'a',
27 24
           href: url,