Skip to content

Commit

Permalink
兼容IE 10
Browse files Browse the repository at this point in the history
  • Loading branch information
huangzheng committed Apr 26, 2019
1 parent 1188a67 commit 82859cf
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 24 deletions.
12 changes: 1 addition & 11 deletions babel.config.js
Expand Up @@ -3,6 +3,7 @@ module.exports = {
[
'@babel/preset-env',
{
useBuiltIns: 'usage',
modules: false,
targets: {
browsers: require('./package.json').browserslist
Expand All @@ -24,15 +25,4 @@ module.exports = {
]
],
comments: false,
env: {
test: {
presets: [
'env',
// 'stage-2'
],
plugins: [
'istanbul'
]
}
}
}
7 changes: 1 addition & 6 deletions html.tpl.html
Expand Up @@ -7,17 +7,12 @@
<meta name="description" content="<%= htmlWebpackPlugin.options.appConfig.description %>">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<link rel="shortcut icon" href="img/favorites.png">
<!--<link rel="icon" sizes="any" mask href="img/favorites.png">-->
<script>
(function () {
var ieInf = navigator.userAgent.match(/msie\s*(\d+)/i);
if (!ieInf) ieInf = navigator.userAgent.match(/Trident.+rv:(\d+)/i);
if (ieInf) {
if (parseInt(ieInf[1]) >= 10) {
document.write('<script src="js/es6-promise.auto.min.js"></sc' + 'ript>')
}
else {
if (parseInt(ieInf[1]) < 10) {
document.write(
'<div style="background:#FFFCCF;text-align: center;line-height: 30px">'
+ '您的浏览器版本太低,功能无法使用。请升级到IE10以上,或使用Chrome、Firefox等现代浏览器~'
Expand Down
7 changes: 1 addition & 6 deletions src/pages/iconfontPreview/template.html
Expand Up @@ -7,17 +7,12 @@
<meta name="description" content="<%= htmlWebpackPlugin.options.appConfig.description %>">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<link rel="shortcut icon" href="img/favorites.png">
<!--<link rel="icon" sizes="any" mask href="img/favorites.png">-->
<script>
(function () {
var ieInf = navigator.userAgent.match(/msie\s*(\d+)/i);
if (!ieInf) ieInf = navigator.userAgent.match(/Trident.+rv:(\d+)/i);
if (ieInf) {
if (parseInt(ieInf[1]) >= 10) {
document.write('<script src="js/es6-promise.auto.min.js"></sc' + 'ript>')
}
else {
if (parseInt(ieInf[1]) > 10) {
document.write(
'<div style="background:#FFFCCF;text-align: center;line-height: 30px">'
+ '您的浏览器版本太低,功能无法使用。请升级到IE10以上,或使用Chrome、Firefox等现代浏览器~'
Expand Down
1 change: 0 additions & 1 deletion static/js/es6-promise.auto.min.js

This file was deleted.

0 comments on commit 82859cf

Please sign in to comment.