Skip to content

Commit 34a4fd4

Browse files
committed
'兼容IE10下不进入quill组件'
1 parent 69484a9 commit 34a4fd4

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ vue.js封装sChart.js的图表组件。访问地址:[vue-schart](https://githu
128128
### Vue-Quill-Editor ###
129129
基于Quill、适用于Vue2的富文本编辑器。访问地址:[vue-quill-editor](https://github.com/surmon-china/vue-quill-editor)
130130

131+
(IE10及以下不支持)
132+
131133
### mavonEditor ###
132134
基于Vue的markdown编辑器。访问地址:[mavonEditor](https://github.com/hinesboy/mavonEditor)
133135

src/main.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,17 @@ router.beforeEach((to, from, next) => {
1717
// 如果是管理员权限则可进入,这里只是简单的模拟管理员权限而已
1818
role === 'admin' ? next() : next('/login');
1919
}else{
20-
next();
20+
// 简单的判断IE10及以下不进入富文本编辑器,该组件不兼容
21+
if(navigator.userAgent.indexOf('MSIE') && to.path === '/editor'){
22+
Vue.prototype.$alert('vue-quill-editor组件不兼容IE10及以下浏览器,请使用更高版本的浏览器查看', '浏览器不兼容通知', {
23+
confirmButtonText: '确定'
24+
});
25+
}else{
26+
next();
27+
}
2128
}
2229
})
23-
30+
console.log(navigator.userAgent);
2431
new Vue({
2532
router,
2633
render: h => h(App)

0 commit comments

Comments
 (0)