Browse Source

refine code

Pan 6 years ago
parent
commit
b74ab40e2a

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

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

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

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