Skip to content

Commit 4fedd2e

Browse files
committedJun 4, 2020
fix: compatibility with vetur (PanJiaChen#1700)
1 parent 5c6ddaa commit 4fedd2e

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
@@ -155,9 +155,9 @@ export default {
155155
_this.fullscreen = e.state
156156
})
157157
},
158-
//it will try to keep these URLs intact
159-
//https://www.tiny.cloud/docs-3x/reference/configuration/Configuration3x@convert_urls/
160-
//https://stackoverflow.com/questions/5196205/disable-tinymce-absolute-to-relative-url-conversions
158+
// it will try to keep these URLs intact
159+
// https://www.tiny.cloud/docs-3x/reference/configuration/Configuration3x@convert_urls/
160+
// https://stackoverflow.com/questions/5196205/disable-tinymce-absolute-to-relative-url-conversions
161161
convert_urls: false
162162
// 整合七牛上传
163163
// 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)
Please sign in to comment.