From 34a4fd4b4fcfeac1a4aeff743344a1773049d6ff Mon Sep 17 00:00:00 2001 From: lin-xin <2981207131@qq.com> Date: Fri, 13 Apr 2018 09:33:23 +0800 Subject: [PATCH] =?UTF-8?q?'=E5=85=BC=E5=AE=B9IE10=E4=B8=8B=E4=B8=8D?= =?UTF-8?q?=E8=BF=9B=E5=85=A5quill=E7=BB=84=E4=BB=B6'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 ++ src/main.js | 11 +++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 663fa05..914de4f 100644 --- a/README.md +++ b/README.md @@ -128,6 +128,8 @@ vue.js封装sChart.js的图表组件。访问地址:[vue-schart](https://githu ### Vue-Quill-Editor ### 基于Quill、适用于Vue2的富文本编辑器。访问地址:[vue-quill-editor](https://github.com/surmon-china/vue-quill-editor) +(IE10及以下不支持) + ### mavonEditor ### 基于Vue的markdown编辑器。访问地址:[mavonEditor](https://github.com/hinesboy/mavonEditor) diff --git a/src/main.js b/src/main.js index 7db2dd5..8449b5e 100644 --- a/src/main.js +++ b/src/main.js @@ -17,10 +17,17 @@ router.beforeEach((to, from, next) => { // 如果是管理员权限则可进入,这里只是简单的模拟管理员权限而已 role === 'admin' ? next() : next('/login'); }else{ - next(); + // 简单的判断IE10及以下不进入富文本编辑器,该组件不兼容 + if(navigator.userAgent.indexOf('MSIE') && to.path === '/editor'){ + Vue.prototype.$alert('vue-quill-editor组件不兼容IE10及以下浏览器,请使用更高版本的浏览器查看', '浏览器不兼容通知', { + confirmButtonText: '确定' + }); + }else{ + next(); + } } }) - +console.log(navigator.userAgent); new Vue({ router, render: h => h(App)