BlogBlog
首页
  • Vue
  • TypeScript
  • React
  • Angular
  • Node.js
  • 小程序
  • Flutter
  • 数据产品
  • 大数据

    • Hadoop
    • Hive
    • Spark
  • MySQL
  • Redis
  • Java
  • Python
  • Golang
GitHub
首页
  • Vue
  • TypeScript
  • React
  • Angular
  • Node.js
  • 小程序
  • Flutter
  • 数据产品
  • 大数据

    • Hadoop
    • Hive
    • Spark
  • MySQL
  • Redis
  • Java
  • Python
  • Golang
GitHub
  • Vue 学习1

command

npm install -g @vue/cli
vue --version
vue create my-app
.\node_modules\.bin\vue --version
.\node_modules\.bin\vue create my-app
# 选择

vue ui

.\node_modules\.bin\vue  ui
相关的配置文件 vue.config.js

配置参数 -> https://cli.vuejs.org/zh/config/?#babel
baseUri: process.env.BASE_URL || '/', // 部署应用时的基本 URL
outputDir: 'dist', // 输出文件目录
devServer: { // 配置本地开发服务器
    host: 'localhost',
    port: 8081, // 端口号
    https: false,
    open: true, // 打开浏览器
    before: app => {} // 启动服务器前的回调函数
    proxy: { // 配置代理
        '/api': {
            target: 'http://localhost:3000', // 目标服务器地址
            changeOrigin: true, // 允许跨域
            pathRewrite: {  '^/api': '' }
        }
    }
}

table of contents

  1. vue-cli
  2. vue-router
  3. vuex
  4. vue-devtools
  5. vue-loader
  6. vue-template-compiler
最近更新:: 2025/4/17 16:46
Contributors: alice