zoukankan      html  css  js  c++  java
  • vue使用模块

    使用官方提供的插件(以vue-resource模块为例)

    1. 安装模块
    • 使用--save可以将安装的模块写入到项目的package.json的dependencies中
    • 使用--save-dev可以将安装的模块写入到package.json的devDependencies
    • dependencies和devDependencies的区别:dependencies中的库是生产中使用的,devDependencies是开发的时候使用的,有一些脚手架,编译工具等在生产上不需要
    npm install vue-resource --save
    cnpm install vue-resource --save
    
    1. 在main.js中引入模块,import后面的名字随便写
    import MyVueResource from 'vue-resource'
    
    1. 在main.js中使用模块
    Vue.use(MyVueResource)
    
    1. 在组件里面直接使用

    使用第三方模块

    1. 安装
    2. 在哪里使用哪里import
  • 相关阅读:
    SGU 194. Reactor Cooling(无源汇有上下界的网络流)
    SGU 197.Nice Patterns Strike Back
    Codeforces 474E
    记一个问题的AC
    UVM Primer
    UVM Primer
    UVM Primer
    UVM Primer
    UVM Primer
    UVM Primer
  • 原文地址:https://www.cnblogs.com/qian-shan/p/12745817.html
Copyright © 2011-2022 走看看