File tree 4 files changed +40
-1
lines changed
assets/less/iview/components
4 files changed +40
-1
lines changed Original file line number Diff line number Diff line change 4
4
// @import "badge";
5
5
// @import "circle";
6
6
@import " spin" ;
7
- // @import "alert";
7
+ @import " alert" ;
8
8
// @import "collapse";
9
9
// @import "card";
10
10
@import " message" ;
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<div class =" layout-default" >
3
+ <!-- Browse Happy -->
4
+ <Collapse >
5
+ <IAlert
6
+ v-if =" isIE"
7
+ banner
8
+ type =" warning"
9
+ closable
10
+ :style =" {marginBottom: 0,marginRight: logged && '48px', zIndex: 100}"
11
+ >
12
+ <!-- eslint-disable-next-line -->
13
+ 您正在使用过时的 IE 浏览器,因此排版可能会错乱。为了您的浏览体验,强烈建议您更换至 <a class =" primary-color" href =" https://browsehappy.com/" target =" _blank" >现代浏览器</a >
14
+ </IAlert >
15
+ </Collapse >
16
+
3
17
<CommonHeader />
4
18
5
19
<div class =" container main" >
23
37
</template >
24
38
25
39
<script >
40
+ import { isIE } from ' @/utils'
26
41
import CommonHeader from ' @/components/layout/CommonHeader.vue'
27
42
import CommonFooter from ' @/components/layout/CommonFooter.vue'
28
43
import FloatWidget from ' @/components/layout/FloatWidget.vue'
@@ -48,6 +63,18 @@ export default {
48
63
ModalPinned,
49
64
ModalPassword,
50
65
},
66
+ data () {
67
+ return {
68
+ isIE: false ,
69
+ }
70
+ },
71
+ mounted () {
72
+ if (isIE ()) {
73
+ setTimeout (() => {
74
+ this .isIE = true
75
+ }, 500 )
76
+ }
77
+ },
51
78
}
52
79
</script >
53
80
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import Vue from 'vue'
2
2
import '@/assets/less/index.less'
3
3
4
4
import {
5
+ Alert ,
5
6
Button ,
6
7
Breadcrumb ,
7
8
BreadcrumbItem ,
@@ -32,6 +33,7 @@ import {
32
33
} from 'iview'
33
34
34
35
const components = {
36
+ Alert,
35
37
Button,
36
38
Breadcrumb,
37
39
BreadcrumbItem,
Original file line number Diff line number Diff line change @@ -21,6 +21,16 @@ export const isNumber = val => {
21
21
else return / ^ \d + $ / . test ( val )
22
22
}
23
23
24
+ /**
25
+ * 判断是否是 IE 浏览器
26
+ */
27
+ export function isIE ( ) {
28
+ if ( process . client ) {
29
+ return ! ! window . ActiveXObject || 'ActiveXObject' in window
30
+ }
31
+ return null
32
+ }
33
+
24
34
/**
25
35
* 获取关注状态
26
36
* @param {boolean } follower 被关注
You can’t perform that action at this time.
0 commit comments