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模式
    });
  • 相关阅读:
    android中BuildConfig.DEBUG的使用
    Http 状态码完整说明
    Java 线程池
    Gson简要使用笔记
    Android Loader详解四:回调及完整例子
    Android Loader详解三:重启与回调
    Android Loader详解二:使用加载器
    Android Loader详解一:概述
    Metrics介绍和Spring的集成(转)
    Web.xml配置详解之context-param(转)
  • 原文地址:https://www.cnblogs.com/ssmd/p/9777055.html
Copyright © 2011-2022 走看看