背景
这次项目是要兼容微信小程序、h5的。目前开发完成发现,微信小程序和手机浏览器打开h5,页面都是正常的。在PC浏览器和ipad上打开H5,出现了布局和字体错乱。
解决步骤
自定义模板路径
在manifest.json H5配置中,填写 index.html 模板路径
这是为了方便些条件编译当在h5下的时候
在index.template.html中
<!DOCTYPE html>
<html lang="zh">
<head>
<link rel="shortcut icon" href="<%= BASE_URL %>static/favicon.ico">
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="ie=edge">