From 2a8f4d9179d4d49e45ac89a2df03da5990f08686 Mon Sep 17 00:00:00 2001 From: yanglbme Date: Tue, 10 Dec 2019 21:47:04 +0800 Subject: [PATCH] fix: fix type error 'window.open is not a function' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复错误 --- assets/scripts/editor.js | 5 +--- assets/scripts/themes/default-theme-css.js | 10 +------ assets/scripts/util.js | 1 - index.html | 35 +++++++++++----------- 4 files changed, 19 insertions(+), 32 deletions(-) diff --git a/assets/scripts/editor.js b/assets/scripts/editor.js index 6b30994..05fd57b 100644 --- a/assets/scripts/editor.js +++ b/assets/scripts/editor.js @@ -198,8 +198,8 @@ let app = new Vue({ localStorage.removeItem('__editor_content'); localStorage.removeItem('__css_content'); this.setDefaultContent(); - this.editor.focus(); this.cssEditor.setValue(DEFAULT_CSS_CONTENT); + this.editor.focus(); this.refresh(); }).catch(() => { this.editor.focus(); @@ -263,9 +263,6 @@ let app = new Vue({ type: 'warning' }); } - }, - visit(url) { - window.open(url); } }, updated() { diff --git a/assets/scripts/themes/default-theme-css.js b/assets/scripts/themes/default-theme-css.js index 3efce1e..189c4ac 100644 --- a/assets/scripts/themes/default-theme-css.js +++ b/assets/scripts/themes/default-theme-css.js @@ -44,12 +44,4 @@ strong { /* 脚注文字 */ footnote { } - - - - - -` - - - +` \ No newline at end of file diff --git a/assets/scripts/util.js b/assets/scripts/util.js index 93f7a96..039e182 100644 --- a/assets/scripts/util.js +++ b/assets/scripts/util.js @@ -16,7 +16,6 @@ let setColor = setColorWithTemplate(default_theme); function customCssWithTemplate(jsonString, color) { let custom_theme = JSON.parse(JSON.stringify(default_theme)); // block - console.log(jsonString) custom_theme.block.h1['border-bottom'] = `2px solid ${color}`; custom_theme.block.h2['background'] = color; custom_theme.block.h3['border-left'] = `3px solid ${color}`; diff --git a/index.html b/index.html index a3b78df..be1020a 100644 --- a/index.html +++ b/index.html @@ -19,14 +19,14 @@ - - + + - + @@ -113,16 +113,13 @@ - + - - - + + @@ -135,10 +132,14 @@

扫码关注我的公众号,原创技术文章第一时间推送!

- GitHub 仓库 - - Gitee 仓库 - + + GitHub 仓库 + + + + Gitee 仓库 + + @@ -147,7 +148,7 @@ - + @@ -170,6 +171,4 @@ - - - + \ No newline at end of file