File tree Expand file tree Collapse file tree 2 files changed +19
-12
lines changed Expand file tree Collapse file tree 2 files changed +19
-12
lines changed Original file line number Diff line number Diff line change @@ -155,9 +155,9 @@ export default {
155
155
_this.fullscreen = e.state
156
156
})
157
157
},
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
161
161
convert_urls: false
162
162
// 整合七牛上传
163
163
// images_dataimg_filter(img) {
Original file line number Diff line number Diff line change 1
-
2
1
<template>
3
- <!-- eslint-disable vue/require-component-is -->
4
- <component v-bind="linkProps(to)">
2
+ <component :is="type" v-bind="linkProps(to)">
5
3
<slot />
6
4
</component>
7
5
</template>
@@ -16,19 +14,28 @@ export default {
16
14
required: true
17
15
}
18
16
},
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
+ },
19
28
methods: {
20
- linkProps(url ) {
21
- if (isExternal(url) ) {
29
+ linkProps(to ) {
30
+ if (this. isExternal) {
22
31
return {
23
- is: 'a',
24
- href: url,
32
+ href: to,
25
33
target: '_blank',
26
34
rel: 'noopener'
27
35
}
28
36
}
29
37
return {
30
- is: 'router-link',
31
- to: url
38
+ to: to
32
39
}
33
40
}
34
41
}
You can’t perform that action at this time.
0 commit comments