Skip to content

Commit e8a151c

Browse files
committed
fix: temporarily for compatibility with vetur
1 parent 9574643 commit e8a151c

File tree

1 file changed

+16
-8
lines changed
  • src/views/layout/components/Sidebar

1 file changed

+16
-8
lines changed

src/views/layout/components/Sidebar/Link.vue

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11

22
<template>
3-
<!-- eslint-disable vue/require-component-is -->
4-
<component v-bind="linkProps(to)">
3+
<component :is="type" v-bind="linkProps(to)">
54
<slot/>
65
</component>
76
</template>
@@ -16,19 +15,28 @@ export default {
1615
required: true
1716
}
1817
},
18+
computed: {
19+
isExternal() {
20+
return isExternal(this.to)
21+
},
22+
type() {
23+
if (this.isExternal) {
24+
return 'a'
25+
}
26+
return 'router-link'
27+
}
28+
},
1929
methods: {
20-
linkProps(url) {
21-
if (isExternal(url)) {
30+
linkProps(to) {
31+
if (this.isExternal) {
2232
return {
23-
is: 'a',
24-
href: url,
33+
href: to,
2534
target: '_blank',
2635
rel: 'noopener'
2736
}
2837
}
2938
return {
30-
is: 'router-link',
31-
to: url
39+
to: to
3240
}
3341
}
3442
}

0 commit comments

Comments
 (0)