审核警告:“data-custom”太新,无法在此检查的页面上运行,以及cannot declare a const variable twice 'n'解决。
在ios大哥那边显示这个问题:审核警告:“data-custom”太新,无法在此检查的页面上运行,但是h5这边显示的是
cannot declare a const variable twice 'n'的错误
解决方法:
swiper版本太高,在编译后模拟器的safari不识别一些代码,我现在的理解就是这样。要么就改变swiper版本,要么就按我说的加一点vue的配置。因为改了swiper版本后相应功能代码可能会有改动,我觉得太麻烦,所以我就是加的vue配置
vue2.x如下:
build/webpack.base.conf.js
module: { rules: [ { test: /.vue$/, loader: 'vue-loader', options: vueLoaderConfig }, { test: /.js$/, loader: 'babel-loader', include: [ resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client'), //新增如下代码 resolve('node_modules/swiper'), resolve('node_modules/dom7'), resolve('node_modules/ssr-window') ], },
build/webpack.prod.conf.js
new UglifyJsPlugin({ uglifyOptions: { compress: { warnings: false }, //新增如下代码 mangle: { safari10: true } }, sourceMap: config.build.productionSourceMap, parallel: true }),
Vue CLI 3.x 下
在 vue.config.js 中增加 transpileDependencies 配置
module.exports = { transpileDependencies: [ "swiper", "dom7", "ssr-window" ]}