zoukankan      html  css  js  c++  java
  • 解决白屏(vue)

    1.npm安装

    npm install babel-polyfill
    npm install es6-promise

     package.json中会出现

    "babel-polyfill": "^6.26.0",
    "es6-promise": "^4.1.1",

      

    2.main.js引入

    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"],
    }
  • 相关阅读:
    自定义Dialog
    AlertDialog
    Toast
    WebView
    《构建之法》阅读笔记3
    UI组件之GridView
    ScrollView&HorizontalScrollView
    UI组件之ImageView
    UI组件之ListView
    每周总结(1.24)
  • 原文地址:https://www.cnblogs.com/y-lin/p/9335386.html
Copyright © 2011-2022 走看看