Code Monkey home page Code Monkey logo

basic's Introduction

basic

A Vue.js project

Build Setup

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

# clean dist 
npm run clean

For detailed explanation on how things work, consult the docs for vue-loader.

怎么让axios里面then里面都有response的函数签名

    axios.get("/static/item.json", {
        params: {
            id: 101
        }
    }).then(response=>{
        console.log("method then 1", response);
        //返回response
        return response;
    }).then(response=>{
        console.log("method then 2", response);
        //返回response
        return response;
    }).then(response=>{
        console.log("method then 3", response);
        //返回response
        //return response;
    }).then(response=>{
        //上面没有返回response,这里的response就undefined
        console.log("method then 4", response);
        return response;
    })
;E:\Program Files (x86)\Microsoft VS Code\bin

AppData\Roaming\npm\

IE 浏览器 vuex 需要promise 支持(已解决)

# 安装 promise-polyfill
npm install promise-polyfill

# 把 node_modules/promise-polyfill/promise.min.js 移到 polyfill/目录中

# 页面添加 IE条件性注释
<![if IE]> 
    <script src="/polyfill/promise.min.js"></script>
<![endif]> 
# 安装 es6-promise
npm install es6-promise

# main.js文件引入 
import 'es6-promise/auto'

# webpack.config.js 配置
  entry: {
    app: './src/main.js',
    // app: ['promise-polyfill', './src/main.js'],
    vendor: [
        'es6-promise/auto',
        ...
    ]
  },

    module: {
        // noParse: /promise-polyfill\.js$/, // avoid webpack shimming process
        noParse: /es6-promise\.js$/, // avoid webpack shimming process
        ...
    }

basic's People

Contributors

lixuguang1988 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.