Skip to content

Commit fc26c31

Browse files
authored
fix: compatibility with vetur (PanJiaChen#1700)
1 parent 9580c43 commit fc26c31

File tree

2 files changed

+19
-12
lines changed

2 files changed

+19
-12
lines changed

src/components/Tinymce/index.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,9 @@ export default {
148148
_this.fullscreen = e.state
149149
})
150150
},
151-
//it will try to keep these URLs intact
152-
//https://www.tiny.cloud/docs-3x/reference/configuration/Configuration3x@convert_urls/
153-
//https://stackoverflow.com/questions/5196205/disable-tinymce-absolute-to-relative-url-conversions
151+
// it will try to keep these URLs intact
152+
// https://www.tiny.cloud/docs-3x/reference/configuration/Configuration3x@convert_urls/
153+
// https://stackoverflow.com/questions/5196205/disable-tinymce-absolute-to-relative-url-conversions
154154
convert_urls: false
155155
// 整合七牛上传
156156
// images_dataimg_filter(img) {

src/layout/components/Sidebar/Link.vue

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
21
<template>
3-
<!-- eslint-disable vue/require-component-is -->
4-
<component v-bind="linkProps(to)">
2+
<component :is="type" v-bind="linkProps(to)">
53
<slot />
64
</component>
75
</template>
@@ -16,19 +14,28 @@ export default {
1614
required: true
1715
}
1816
},
17+
computed: {
18+
isExternal() {
19+
return isExternal(this.to)
20+
},
21+
type() {
22+
if (this.isExternal) {
23+
return 'a'
24+
}
25+
return 'router-link'
26+
}
27+
},
1928
methods: {
20-
linkProps(url) {
21-
if (isExternal(url)) {
29+
linkProps(to) {
30+
if (this.isExternal) {
2231
return {
23-
is: 'a',
24-
href: url,
32+
href: to,
2533
target: '_blank',
2634
rel: 'noopener'
2735
}
2836
}
2937
return {
30-
is: 'router-link',
31-
to: url
38+
to: to
3239
}
3340
}
3441
}

0 commit comments

Comments
 (0)