Skip to content

Commit 645e902

Browse files
committed
'重写mavonEditor的flex样式兼容IE'
1 parent 34a4fd4 commit 645e902

File tree

5 files changed

+76
-4
lines changed

5 files changed

+76
-4
lines changed

config/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ module.exports = {
6565
* Source Maps
6666
*/
6767

68-
productionSourceMap: true,
68+
productionSourceMap: false,
6969
// https://webpack.js.org/configuration/devtool/#production
7070
devtool: '#source-map',
7171

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
},
6666
"browserslist": [
6767
"> 1%",
68-
"last 2 versions",
68+
"last 5 versions",
6969
"not ie <= 8"
7070
]
7171
}

src/components/page/Markdown.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
<script>
2121
import { mavonEditor } from 'mavon-editor'
2222
import 'mavon-editor/dist/css/index.css'
23+
// 重写mavon的flex样式来兼容IE
24+
import 'static/css/mavon-flex.css'
2325
export default {
2426
data: function(){
2527
return {

src/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ router.beforeEach((to, from, next) => {
1818
role === 'admin' ? next() : next('/login');
1919
}else{
2020
// 简单的判断IE10及以下不进入富文本编辑器,该组件不兼容
21-
if(navigator.userAgent.indexOf('MSIE') && to.path === '/editor'){
21+
if(navigator.userAgent.indexOf('MSIE') > -1 && to.path === '/editor'){
2222
Vue.prototype.$alert('vue-quill-editor组件不兼容IE10及以下浏览器,请使用更高版本的浏览器查看', '浏览器不兼容通知', {
2323
confirmButtonText: '确定'
2424
});
@@ -27,7 +27,7 @@ router.beforeEach((to, from, next) => {
2727
}
2828
}
2929
})
30-
console.log(navigator.userAgent);
30+
3131
new Vue({
3232
router,
3333
render: h => h(App)

static/css/mavon-flex.css

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
.v-note-wrapper{
2+
display: flex;
3+
flex-direction: column;
4+
}
5+
.v-note-wrapper .v-note-op{
6+
display: flex;
7+
flex: none;
8+
}
9+
.v-note-wrapper .v-note-op .left,
10+
.v-note-wrapper .v-note-op .right{
11+
flex: 1;
12+
}
13+
.v-note-wrapper {
14+
display: flex;
15+
flex-direction: column;
16+
}
17+
.v-note-wrapper .v-note-op {
18+
display: flex;
19+
flex: none;
20+
}
21+
.v-note-wrapper .v-note-op .left,
22+
.v-note-wrapper .v-note-op .right {
23+
flex: 1;
24+
}
25+
26+
.v-note-wrapper .v-note-panel {
27+
display: flex;
28+
flex: 1;
29+
min-height: 500px;
30+
}
31+
.v-note-wrapper .v-note-panel .v-note-edit.divarea-wrapper {
32+
flex: 0 0 50%;
33+
}
34+
35+
.v-note-wrapper .v-note-panel .v-note-edit.divarea-wrapper.single-edit {
36+
flex: 0 0 100%;
37+
}
38+
.v-note-wrapper .v-note-panel .v-note-edit.divarea-wrapper.single-show {
39+
width: 0;
40+
flex: 0 0 0;
41+
display: none;
42+
}
43+
44+
.v-note-wrapper .v-note-panel .v-note-show {
45+
flex: 0 0 50%;
46+
}
47+
.v-note-wrapper .v-note-panel .v-note-show.single-show {
48+
flex: 0 0 100%;
49+
}
50+
51+
.v-note-wrapper .v-note-panel .v-note-navigation-wrapper {
52+
display: flex;
53+
flex-direction: column;
54+
}
55+
56+
.v-note-wrapper .v-note-panel .v-note-navigation-wrapper .v-note-navigation-title {
57+
flex: none;
58+
}
59+
60+
.v-note-wrapper .v-note-panel .v-note-navigation-wrapper .v-note-navigation-content {
61+
flex: 1;
62+
}
63+
.v-note-img-wrapper{
64+
display: flex;
65+
justify-content: center;
66+
align-items: center;
67+
}
68+
.v-note-img-wrapper img {
69+
flex: 0 0 auto;
70+
}

0 commit comments

Comments
 (0)