zoukankan      html  css  js  c++  java
  • VUE开发公众号IOS9白屏问题

    备注:IOS9白屏问题出现在内核解析,在commitJS中回调继续调用接口时,ES6语法解析错误导致白屏。


    通过安装npm install babel-polyfill,npm install es6-promise对代码再次解析。

    1.npm安装

    npm install babel-polyfill
    npm install es6-promise

    安装后package.json中会出现:
    "babel-polyfill": "^6.26.0",
    "es6-promise": "^4.1.1",

    import 'babel-polyfill'
    import Vue from 'vue'
    import Es6Promise from 'es6-promise'
    require('es6-promise').polyfill()
    Es6Promise.polyfill()

     3.进入webpack.base.conf.js进行如下配置:

      

      module.exports = {
        entry: {
        app: ['babel-polyfill', './src/main.js']
      },
        module: {
        rules: [{
        test: /.vue$/,
        loader: 'vue-loader',
        options: vueLoaderConfig
      },
      {
        test: /.js$/,
        loader: 'babel-loader',
        query:{presets:['es2015']},
        include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')]
      }, 

     4.最后在在.babelrc文件里加入

    {
      "presets":["es2015", "stage-2"],
    }
  • 相关阅读:
    自定义view分析-Pull-to-Refresh.Rentals-Android
    laucher-icon的加载过程
    android shape 布局文件
    android canvas
    解释器模式(Interpreter)
    中介者模式(Mediator)
    Code obfuscation
    Table Tennis Game 2
    最小公倍数的对数
    C语言基础
  • 原文地址:https://www.cnblogs.com/webh5/p/11624663.html
Copyright © 2011-2022 走看看