zoukankan      html  css  js  c++  java
  • Vue

    Vue
    启动vue
    npm run dev
    部署vue项目
    cnpm install -g vue-cli
    cnpm install
    cnpm install vue-ydui --save
    删除项目目录下的 node_modules 目录,Linux下用root账户重新 npm install 或者 淘宝镜像 cnpm install ,Windows下用管理员权限运行terminal运行 npm install 或者 淘宝镜像 cnpm install。
    删除node_modules
    再执行cnpm install
    还缺少的xxx就再cnpm install xxx
    vue运行报错
    删除package.json中
    "dependencies": {
        "axios": "^0.16.1",
        "babel-runtime": "^6.23.0",
        "chalk": "^1.1.3",
        "jquery": "^2.2.3",
        "node-sass": "^4.5.3",
        "vue": "^2.2.6",
        "vue-router": "^2.3.1",
        "vue-ydui": "^0.5.8",
        "vuex": "^2.3.1"
      },
    "vue-ydui": "^0.5.8",
    nginx代理部署vue
    nginx
    location ^~ /mc/ {
            proxy_pass http://192.168.3.100:8082/;
            proxy_set_header   HOST             $host;
            proxy_set_header   X-Real-IP        $remote_addr;
            proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
        }
      apache
     .htacess
    <IfModule mod_rewrite.c>
      RewriteEngine On
      RewriteBase /
      RewriteRule ^index.html$ - [L]
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteRule . /index.html [L]
    </IfModule>
    vue
    config/index.js 配置
    module.exports = {
    build: {
    assetsPublicPath: '/mc/', // 公共静态文件的路径前缀.
    }
    }
    vue-router中的Route配置
    const router = new Router({
    base:'/mc/', // 路由路径的前缀,需要和 nginx 中的配置保持一致.
    mode: 'history', // 切换路径模式,变成history模式
    });
  • 相关阅读:
    2020.10.23 19级training 补题报告
    2020.10.17 天梯赛练习 补题报告
    2020.10.16 19级training 补题报告
    2020.10.9 19级training 补题报告
    2020.10.10 天梯赛练习 补题报告
    2020.10.3 天梯赛练习 补题报告
    2020.10.2 19级training 补题报告
    第十届山东省ACM省赛复现补题报告
    VVDI Key Tool Plus Adds VW Passat 2015 Key via OBD
    Xhorse VVDI Prog Software V5.0.3 Adds Many MCUs
  • 原文地址:https://www.cnblogs.com/ssmd/p/9777055.html
Copyright © 2011-2022 走看看