From 4fedd2e8d8ce9753667a4c7d740dfd37fdd8855a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=B1=E8=A3=A4=E8=A1=A9?= Date: Mon, 4 May 2020 21:30:58 +0800 Subject: [PATCH] fix: compatibility with vetur (#1700) --- src/components/Tinymce/index.vue | 6 +++--- src/layout/components/Sidebar/Link.vue | 25 ++++++++++++++++--------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/src/components/Tinymce/index.vue b/src/components/Tinymce/index.vue index ddb30243..8fb5cc8d 100644 --- a/src/components/Tinymce/index.vue +++ b/src/components/Tinymce/index.vue @@ -155,9 +155,9 @@ export default { _this.fullscreen = e.state }) }, - //it will try to keep these URLs intact - //https://www.tiny.cloud/docs-3x/reference/configuration/Configuration3x@convert_urls/ - //https://stackoverflow.com/questions/5196205/disable-tinymce-absolute-to-relative-url-conversions + // it will try to keep these URLs intact + // https://www.tiny.cloud/docs-3x/reference/configuration/Configuration3x@convert_urls/ + // https://stackoverflow.com/questions/5196205/disable-tinymce-absolute-to-relative-url-conversions convert_urls: false // 整合七牛上传 // images_dataimg_filter(img) { diff --git a/src/layout/components/Sidebar/Link.vue b/src/layout/components/Sidebar/Link.vue index eb4dd107..530b3d5b 100644 --- a/src/layout/components/Sidebar/Link.vue +++ b/src/layout/components/Sidebar/Link.vue @@ -1,7 +1,5 @@ - @@ -16,19 +14,28 @@ export default { required: true } }, + computed: { + isExternal() { + return isExternal(this.to) + }, + type() { + if (this.isExternal) { + return 'a' + } + return 'router-link' + } + }, methods: { - linkProps(url) { - if (isExternal(url)) { + linkProps(to) { + if (this.isExternal) { return { - is: 'a', - href: url, + href: to, target: '_blank', rel: 'noopener' } } return { - is: 'router-link', - to: url + to: to } } }