<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      Vue隨記

      vue前端隨記

      環境準備

      1. 下載并安裝 Node.js

      2. 安裝vue 環境

        # 安裝淘寶npm
        npm install -g cnpm --registry=https://registry.npm.taobao.org
        # vue-cli 安裝依賴包
        cnpm install --g vue-cli
        
      3. 新建項目

        # 打開vue的可視化管理工具界面
        vue ui	# 注意,要vue3.X 及以上版本,此命令才會生效
        

        運行vue ui之后,會為我們打開一個 http://localhost:8080 的頁面.

      4. 安裝element-ui

        # 切換到項目根目錄
        cd vueblog-vue
        # 安裝element-ui
        cnpm install element-ui --save
        

        然后我們打開項目src目錄下的main.js,引入element-ui依賴。

        import Element from 'element-ui'
        import "element-ui/lib/theme-chalk/index.css"
        Vue.use(Element)
        
      5. 安裝axios

        cnpm install axios --save
        

        然后同樣我們在main.js中全局引入axios。

        import axios from 'axios'
        Vue.prototype.$axios = axios 
        

      vue中設置height:100%無效的問題及解決方法

      這時候設置height: 100%;是無效的,在chrome的Elements中發現height仍然是0px.

      設置高度100%時,div的高度會等同于其父元素的高度。而上面中id為app的div(vue掛載的div)的父節點是body標簽,body標簽的父節點是html標簽。在默認情況下html和body標簽的高度為auto,而瀏覽器是不會自動給標簽添加高度的,所以html和body標簽就為0,自然子div的高度設置為100%就不起作用了。

      此時應該在App.vue文件style中添加如下代碼:

      html,body,#app{
      
        height:100%;
      
      }
      

      vue 打包部署 Nginx 步驟

      1. 項目的根目錄下創建 vue.config.js 文件

      vue.config.js

      module.exports={
          publicPath: '/'
      }
      
      1. 在控制臺執行 npm run build 命令

      2. 將生成的文件夾 dist 里面的文件拷貝到 Nginx html 文件夾下面.

      3. 修改 Nginx 配置文件.

        nginx.conf

        server {
         listen 80;
         server_name 120.77 .158 .169;
         # 指定允許跨域的方法, * 代表所有
         add_header Access - Control - Allow - Methods * ;
         # 預檢命令的緩存, 如果不緩存每次會發送兩次請求
         add_header Access - Control - Max - Age 3600;
         # 不帶cookie請求, 并設置為false
         add_header Access - Control - Allow - Credentials false;
         # 表示允許這個域跨域調用( 客戶端發送請求的域名和端口)
         # $http_origin動態獲取請求客戶端請求的域 不用 * 的原因是帶cookie的請求不支持 * 號
         add_header Access - Control - Allow - Origin $http_origin;
         # 表示請求頭的字段 動態獲取
         add_header Access - Control - Allow - Headers
         $http_access_control_request_headers;
         # OPTIONS預檢命令, 預檢命令通過時才發送請求
         # 檢查請求的類型是不是預檢命令
         if ($request_method = OPTIONS) {
             return 200;
         }
         #charset koi8 - r;
         #access_log logs / host.access.log main;
         location / {
                 root / www / server / nginx / html;
                 try_files $uri $uri / /index.html last;
                 index / index.htm;
        
                 #配置跨域請求
                 location /sku {
                     proxy_pass http: //39.98.123.211:8216/;
                 }
        
      4. 啟動Nginx, 測試訪問即可.

      Linux 下安裝Nginx 服務

      1. 去官網下載安裝包 http://nginx.org/en/download.html nginx-1.21.3.tar.gz, 解壓后上傳到 Linux 服務器上.

      2. 進入Nginx 文件夾下, 執行配置命令:

        ./configure --prefix=/usr/local/nginx
        

        當報錯 : Permission denied 拒絕訪問的時候, 執行下面命令

        chmod +x ./configure
        

        然后重試

        ./configure --prefix=/usr/local/nginx
        

        配置的時候可能會出現類似這樣的信息

        ./configure: error: the HTTP rewrite module requires the PCRE library.
        You can either disable the module by using --without-http_rewrite_module
        option, or install the PCRE library into the system, or build the PCRE library
        statically from the source with nginx by using --with-pcre=<path> option. 
        

        安裝pcre-devel解決問題

        yum -y install pcre-devel
        

        安裝完成后再執行

        ./configure --prefix=/usr/local/nginx
        

        執行完后還有可能會出現這樣的問題:

        checking for PCRE JIT support ... not found
        checking for system md library ... not found
        checking for system md5 library ... not found
        checking for OpenSSL md5 crypto library ... not found
        checking for sha1 in system md library ... not found
        checking for OpenSSL sha1 crypto library ... not found
        checking for zlib library ... found
        

        解決辦法:

        yum -y install openssl openssl-devel
        

        安裝完成后再執行

        ./configure --prefix=/usr/local/nginx
        

        出現這個說明, 說明配置成功

        Configuration summary
          + using system PCRE library
          + OpenSSL library is not used
          + using system zlib library
        
          nginx path prefix: "/usr/local/nginx"
          nginx binary file: "/usr/local/nginx/sbin/nginx"
          nginx modules path: "/usr/local/nginx/modules"
          nginx configuration prefix: "/usr/local/nginx/conf"
          nginx configuration file: "/usr/local/nginx/conf/nginx.conf"
          nginx pid file: "/usr/local/nginx/logs/nginx.pid"
          nginx error log file: "/usr/local/nginx/logs/error.log"
          nginx http access log file: "/usr/local/nginx/logs/access.log"
          nginx http client request body temporary files: "client_body_temp"
          nginx http proxy temporary files: "proxy_temp"
          nginx http fastcgi temporary files: "fastcgi_temp"
          nginx http uwsgi temporary files: "uwsgi_temp"
          nginx http scgi temporary files: "scgi_temp"
        
        
      3. 執行安裝命令

        make && make install
        

        出現類似這種說明, 就表示安裝成功了.

        cp conf/nginx.conf '/usr/local/nginx/conf/nginx.conf.default'
        test -d '/usr/local/nginx/logs' \
        	|| mkdir -p '/usr/local/nginx/logs'
        test -d '/usr/local/nginx/logs' \
        	|| mkdir -p '/usr/local/nginx/logs'
        test -d '/usr/local/nginx/html' \
        	|| cp -R html '/usr/local/nginx'
        test -d '/usr/local/nginx/logs' \
        	|| mkdir -p '/usr/local/nginx/logs'
        	
        make[1]: Leaving directory '/myweb/nginx-1.21.3'
        
        

        安裝完后/usr/local/nginx 后出現幾個文件夾conf、html、logs、sbin

      4. 啟動Nginx

        ./usr/nginx/sbin/nginx
        

        此時,訪問 Nginx 默認的 80 端口, 就會出現成功的頁面

      停止nginx
       
      nginx -s stop
       
      重啟nginx
       
      nginx -s reload
       
       
      總結:在linux下安裝nginx,首先需要安裝 gcc-c++編譯器。然后安裝nginx依賴的pcre和zlib包。最后安裝nginx即可。
      

      vue啟動項目命令

      在控制臺輸入: npm run serve

      D:\ideaProject\web\vueadmin-vue> npm run serve
      
      posted @ 2021-06-17 16:02  HonkSun  閱讀(60)  評論(0)    收藏  舉報
      主站蜘蛛池模板: 亚洲综合无码AV在线观看| 特黄aaaaaaaaa毛片免费视频| 九九热在线精品视频99| 亚洲精品一区二区三区在| 国产综合久久久久鬼色| 日本国产精品第一页久久| 久久精品国产99国产精品严洲| 灌南县| 久久久久久亚洲精品成人| 欧美高清一区三区在线专区| 国产精品熟女亚洲av麻豆| 最新AV中文字幕无码专区| 91中文字幕一区二区| 国产精品一二区在线观看| 国产精品国产三级在线专区| 婷婷六月色| 亚洲一区二区三区久久综合| 欧美xxxxhd高清| 美乳丰满人妻无码视频| 欧美高清精品一区二区| 国产av一区二区三区精品| 中文字幕制服国产精品| 确山县| 国产精品午夜福利导航导| 无码伊人66久久大杳蕉网站谷歌| 亚洲欧洲色图片网站| 中文字幕国产精品一区二| 国产热A欧美热A在线视频| 国产69成人精品视频免费| 午夜男女爽爽影院免费视频下载| 亚洲精品一区二区美女| 日本高清在线观看WWW色| 国日韩精品一区二区三区| 国产亚洲欧洲AⅤ综合一区| 国产毛片精品av一区二区| 国产午夜A理论毛片| 妖精视频亚州无吗高清版| 综合亚洲网| 91精品久久久久久无码人妻| 色综合AV综合无码综合网站| 无码天堂va亚洲va在线va|