refine code

This commit is contained in:
Pan 2019-02-13 16:00:14 +08:00
parent 009416282b
commit b74ab40e2a
2 changed files with 3 additions and 6 deletions

View File

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

View File

@ -1,6 +1,6 @@
<template>
<!-- eslint-disable vue/require-component-is-->
<!-- eslint-disable vue/require-component-is -->
<component v-bind="linkProps(to)">
<slot/>
</component>
@ -17,11 +17,8 @@ export default {
}
},
methods: {
isExternalLink(routePath) {
return isExternal(routePath)
},
linkProps(url) {
if (this.isExternalLink(url)) {
if (isExternal(url)) {
return {
is: 'a',
href: url,