refine code
This commit is contained in:
parent
009416282b
commit
b74ab40e2a
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<svg :class="svgClass" aria-hidden="true">
|
<svg :class="svgClass" aria-hidden="true" v-on="$listeners">
|
||||||
<use :xlink:href="iconName"/>
|
<use :xlink:href="iconName"/>
|
||||||
</svg>
|
</svg>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<!-- eslint-disable vue/require-component-is-->
|
<!-- eslint-disable vue/require-component-is -->
|
||||||
<component v-bind="linkProps(to)">
|
<component v-bind="linkProps(to)">
|
||||||
<slot/>
|
<slot/>
|
||||||
</component>
|
</component>
|
||||||
|
@ -17,11 +17,8 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
isExternalLink(routePath) {
|
|
||||||
return isExternal(routePath)
|
|
||||||
},
|
|
||||||
linkProps(url) {
|
linkProps(url) {
|
||||||
if (this.isExternalLink(url)) {
|
if (isExternal(url)) {
|
||||||
return {
|
return {
|
||||||
is: 'a',
|
is: 'a',
|
||||||
href: url,
|
href: url,
|
||||||
|
|
Loading…
Reference in New Issue