欧美一级特黄大片做受成人-亚洲成人一区二区电影-激情熟女一区二区三区-日韩专区欧美专区国产专区

vue-cli3.0+VantUI搭建移動(dòng)端基礎(chǔ)框架-創(chuàng)新互聯(lián)

主要記錄Vant的一些配置,關(guān)于vue怎么安裝、更新、創(chuàng)建項(xiàng)目等問題可以直接看官方文檔,而且3.0是有UI控制臺的,創(chuàng)建項(xiàng)目都是可視化的,很方便。
vue-cli3.0 + Vant UI搭建移動(dòng)端基礎(chǔ)框架
安裝Vant
Vant - 輕量、可靠的移動(dòng)端 Vue 組件庫

成都創(chuàng)新互聯(lián)公司網(wǎng)站建設(shè)公司一直秉承“誠信做人,踏實(shí)做事”的原則,不欺瞞客戶,是我們最起碼的底線! 以服務(wù)為基礎(chǔ),以質(zhì)量求生存,以技術(shù)求發(fā)展,成交一個(gè)客戶多一個(gè)朋友!專注中小微企業(yè)官網(wǎng)定制,成都做網(wǎng)站、網(wǎng)站制作,塑造企業(yè)網(wǎng)絡(luò)形象打造互聯(lián)網(wǎng)企業(yè)效應(yīng)。
npm i vant -S

主要說下按需引用、REM適配、定制主題,因?yàn)楣倬W(wǎng)的描述感覺還是太簡單了,對于剛開始用還是需要一點(diǎn)時(shí)間的。

按需引用
babel-plugin-import 是一款 babel 插件,它會(huì)在編譯過程中將 import 的寫法自動(dòng)轉(zhuǎn)換為按需引入的方式

//安裝 babel-plugin-import 插件
npm i babel-plugin-import -D

然后打開項(xiàng)目,對 babel.config.js 進(jìn)行修改
vue-cli3.0 + Vant UI搭建移動(dòng)端基礎(chǔ)框架

module.exports = {
  plugins: [
    ['import', {
      libraryName: 'vant',
      libraryDirectory: 'es',
      style: true //上圖中我是配置了定制主題的
    }, 'vant']
  ]
};

然后就可以在組件中使用了
vue-cli3.0 + Vant UI搭建移動(dòng)端基礎(chǔ)框架

import { Button, Cell, NavBar } from "vant";
export default {
  components: {
    [Button.name]: Button,
    [Cell.name]: Cell,
    [NavBar.name]: NavBar
  }
};

Rem 適配
Vant 中的樣式默認(rèn)使用px作為單位,如果需要使用rem單位,推薦使用以下兩個(gè)工具

postcss-pxtorem 是一款 postcss 插件,用于將單位轉(zhuǎn)化為 rem
lib-flexible 用于設(shè)置 rem 基準(zhǔn)值
安裝插件

//postcss-pxtorem
npm install postcss-pxtorem --save-dev

//lib-flexible
npm i -S amfe-flexible

修改babel.config.js文件
vue-cli3.0 + Vant UI搭建移動(dòng)端基礎(chǔ)框架

module.exports = {
  presets: ["@vue/app"],
  plugins: [
    [
      "import",
      {
        libraryName: "vant",
        libraryDirectory: "es",
        style: name => `${name}/style/less`
      },
      "vant"
    ]
  ]
};

修改vue.config.js文件,沒有這個(gè)文件就新建一個(gè)
vue-cli3.0 + Vant UI搭建移動(dòng)端基礎(chǔ)框架

const autoprefixer = require("autoprefixer");
const pxtorem = require("postcss-pxtorem");

module.exports = {
  // outputDir: "docs",
  // publicPath: process.env.NODE_ENV === "production" ? "/vant-demo/" : "/",
  css: {
    loaderOptions: {
      postcss: {
        plugins: [
          autoprefixer(),
          pxtorem({
            rootValue: 37.5,
            propList: ["*"]
          })
        ]
      }
    }
  }
};

修改main.js文件
vue-cli3.0 + Vant UI搭建移動(dòng)端基礎(chǔ)框架

import "amfe-flexible";

查看效果,頁面中都變成了rem
vue-cli3.0 + Vant UI搭建移動(dòng)端基礎(chǔ)框架
定制主題
vue-cli3.0 + Vant UI搭建移動(dòng)端基礎(chǔ)框架

modifyVars: {
              red: '#03a9f4',
              blue: '#3eaf7c',
              orange: '#f08d49',
              'text-color': '#111'
            }

所有可用的顏色變量請參考官方的配置文件 配置文件。

這里我是把modifyVars的值放在了單獨(dú)的文件中,這里隨便你怎么做都可以,下面是我的van-custom-theme.js文件內(nèi)容,這樣方便點(diǎn),要改什么直接改就好了。

module.exports.theme = {
  // Color variables
  "@black": "#000",
  "@white": "#fff",
  "@red": "#f44",
  "@blue": "#1989fa",
  "@orange": "#ff976a",
  "@orange-dark": "#ed6a0c",
  "@orange-light": "#fffbe8",
  "@green": "#20C3D7",
  "@gray": "#c8c9cc",
  "@gray-light": "#e5e5e5",
  "@gray-darker": "#7d7e80",
  "@gray-dark": "#969799",

  // Default colors
  "@text-color": "#323233",
  "@border-color": "#ebedf0",
  "@active-color": "#f2f3f5",
  "@background-color": "#f8f8f8",
  "@background-color-light": "#fafafa",

  // ActionSheet
  "@action-sheet-max-height": "90%",
  "@action-sheet-header-height": "44px",
  "@action-sheet-header-font-size": "16px",
  "@action-sheet-item-height": "50px",
  "@action-sheet-item-background": "@white",
  "@action-sheet-item-font-size": "16px",
  "@action-sheet-item-text-color": "@text-color",
  "@action-sheet-subname-color": "@gray-darker",
  "@action-sheet-subname-font-size": "12px",
  "@action-sheet-close-icon-size": "18px",
  "@action-sheet-close-icon-color": "@gray-dark",

  // Badge
  "@badge-font-size": "14px",
  "@badge-line-height": "1.4",
  "@badge-text-color": "@gray-darker",
  "@badge-padding": "20px 12px 20px 9px",
  "@badge-active-color": "@active-color",
  "@badge-background-color": "@background-color",
  "@badge-selected-font-weight": "500",
  "@badge-selected-text-color": "@text-color",
  "@badge-selected-border-color": "@red",
  "@badge-selected-background-color": "@white",

  // BadgeGroup
  "@badge-group-width": "85px",

  // Button
  "@button-mini-height": "22px",
  "@button-mini-min-width": "50px",
  "@button-mini-font-size": "10px",
  "@button-mini-line-height": "20px",
  "@button-small-height": "30px",
  "@button-small-font-size": "12px",
  "@button-small-min-width": "60px",
  "@button-small-line-height": "28px",
  "@button-normal-font-size": "14px",
  "@button-large-height": "50px",
  "@button-large-line-height": "48px",
  "@button-default-height": "44px",
  "@button-default-line-height": "42px",
  "@button-default-font-size": "16px",
  "@button-default-color": "@text-color",
  "@button-default-background-color": "@white",
  "@button-default-border-color": "@border-color",
  "@button-primary-color": "@white",
  "@button-primary-background-color": "@green",
  "@button-primary-border-color": "@green",
  "@button-info-color": "@white",
  "@button-info-background-color": "@blue",
  "@button-info-border-color": "@blue",
  "@button-danger-color": "@white",
  "@button-danger-background-color": "@red",
  "@button-danger-border-color": "@red",
  "@button-warning-color": "@white",
  "@button-warning-background-color": "@orange",
  "@button-warning-border-color": "@orange",
  "@button-bottom-action-default-color": "@white",
  "@button-bottom-action-default-background-color": "@orange",
  "@button-bottom-action-primary-color": "@white",
  "@button-bottom-action-primary-background-color": "@red",
  "@button-border-width": "1px",
  "@button-border-radius": "2px",
  "@button-round-border-radius": "10em",
  "@button-plain-background-color": "@white",
  "@button-disabled-opacity": ".5",

  // Cell
  "@cell-font-size": "14px",
  "@cell-line-height": "24px",
  "@cell-vertical-padding": "10px",
  "@cell-horizontal-padding": "15px",
  "@cell-text-color": "@text-color",
  "@cell-background-color": "@white",
  "@cell-border-color": "@border-color",
  "@cell-active-color": "@active-color",
  "@cell-required-color": "@red",
  "@cell-label-color": "@gray-dark",
  "@cell-label-font-size": "12px",
  "@cell-label-line-height": "18px",
  "@cell-label-margin-top": "3px",
  "@cell-value-color": "@gray-dark",
  "@cell-icon-size": "16px",
  "@cell-right-icon-color": "@gray-dark",
  "@cell-large-vertical-padding": "12px",
  "@cell-large-title-font-size": "16px",
  "@cell-large-label-font-size": "14px",

  // CellGroup
  "@cell-group-background-color": "@white",
  "@cell-group-title-color": "@gray-dark",
  "@cell-group-title-padding": "15px 15px 5px",
  "@cell-group-title-font-size": "14px",
  "@cell-group-title-line-height": "16px",

  // Checkbox
  "@checkbox-size": "20px",
  "@checkbox-border-color": "@gray-light",
  "@checkbox-transition-duration": ".2s",
  "@checkbox-label-margin": "10px",
  "@checkbox-label-color": "@text-color",
  "@checkbox-checked-icon-color": "@blue",
  "@checkbox-disabled-icon-color": "@gray",
  "@checkbox-disabled-label-color": "@gray",
  "@checkbox-disabled-background-color": "@border-color",

  // Collapse
  "@collapse-item-transition-duration": ".3s",
  "@collapse-item-content-padding": "15px",
  "@collapse-item-content-font-size": "13px",
  "@collapse-item-content-line-height": "1.5",
  "@collapse-item-content-text-color": "@gray-dark",
  "@collapse-item-content-background-color": "@white",
  "@collapse-item-title-disabled-color": "@gray",

  // Dialog
  "@dialog-width": "85%",
  "@dialog-font-size": "16px",
  "@dialog-transition": ".3s",
  "@dialog-border-radius": "4px",
  "@dialog-background-color": "@white",
  "@dialog-header-font-weight": "500",
  "@dialog-header-padding-top": "25px",
  "@dialog-header-isolated-padding": "25px 0",
  "@dialog-message-padding": "25px",
  "@dialog-message-font-size": "14px",
  "@dialog-message-line-height": "1.5",
  "@dialog-message-max-height": "60vh",
  "@dialog-has-title-message-text-color": "@gray-darker",
  "@dialog-has-title-message-padding-top": "12px",
  "@dialog-confirm-button-text-color": "@blue",

  // Info
  "@info-size": "16px",
  "@info-color": "@white",
  "@info-padding": "0 3px",
  "@info-font-size": "12px",
  "@info-font-weight": "500",
  "@info-border-width": "1px",
  "@info-background-color": "@red",
  "@info-font-family": "PingFang SC, Helvetica Neue, Arial, sans-serif",

  // List
  "@list-icon-size": "16px",
  "@list-icon-margin-right": "5px",
  "@list-text-color": "@gray-dark",
  "@list-text-font-size": "13px",
  "@list-text-line-height": "50px",

  // NavBar
  "@nav-bar-height": "46px",
  "@nav-bar-background-color": "@white",
  "@nav-bar-arrow-size": "16px",
  "@nav-bar-icon-color": "@blue",
  "@nav-bar-text-color": "@blue",
  "@nav-bar-title-font-size": "16px",
  "@nav-bar-title-text-color": "@text-color",

  // Notify
  "@notify-padding": "6px 15px",
  "@notify-font-size": "14px",
  "@notify-line-height": "20px",

  // NumberKeyboard
  "@number-keyboard-key-height": "54px",
  "@number-keyboard-key-background": "#ebedf0",

  // Overlay
  "@overlay-background-color": "rgba(0, 0, 0, 0.7)",

  // Panel
  "@panel-background-color": "@white",
  "@panel-header-value-color": "@red",
  "@panel-footer-padding": "10px 15px",

  // Radio
  "@radio-size": "20px",
  "@radio-border-color": "@gray-light",
  "@radio-transition-duration": ".2s",
  "@radio-label-margin": "10px",
  "@radio-label-color": "@text-color",
  "@radio-checked-icon-color": "@blue",
  "@radio-disabled-icon-color": "@gray",
  "@radio-disabled-label-color": "@gray",
  "@radio-disabled-background-color": "@border-color",

  // Rate
  "@rate-horizontal-padding": "2px",

  // Slider
  "@slider-active-background-color": "@blue",
  "@slider-inactive-background-color": "@gray-light",
  "@slider-disabled-opacity": ".3",
  "@slider-button-width": "20px",
  "@slider-button-height": "20px",
  "@slider-button-border-radius": "50%",
  "@slider-button-background-color": "@white",
  "@slider-button-box-shadow": "0 1px 2px rgba(0, 0, 0, .5)",

  // Swipe
  "@swipe-indicator": "6px",

  // Switch
  "@switch-width": "2em",
  "@switch-height": "1em",
  "@switch-node-size": "1em",
  "@switch-node-z-index": "1",
  "@switch-node-background-color": "@white",
  "@switch-node-box-shadow":
    "0 3px 1px 0 rgba(0, 0, 0, .05), 0 2px 2px 0 rgba(0, 0, 0, .1), 0 3px 3px 0 rgba(0, 0, 0, .05)",
  "@switch-background-color": "@white",
  "@switch-on-background-color": "@blue",
  "@switch-transition-duration": ".3s",
  "@switch-disabled-opacity": ".4",
  "@switch-border": "1px solid rgba(0, 0, 0, .1)",

  // SwitchCell
  "@switch-cell-padding-top": "9px",
  "@switch-cell-padding-bottom": "9px",

  // Tab
  "@tabs-line-height": "44px",
  "@tabs-card-height": "30px",

  // Tabbar
  "@tabbar-height": "50px",
  "@tabbar-background-color": "@white",

  // TabbarItem
  "@tabbar-item-font-size": "12px",
  "@tabbar-item-text-color": "@gray-darker",
  "@tabbar-item-active-color": "@blue",
  "@tabbar-item-line-height": "1",
  "@tabbar-item-icon-size": "18px",
  "@tabbar-item-margin-bottom": "5px",

  // Tag
  "@tag-padding": ".2em .5em",
  "@tag-font-size": "10px",
  "@tag-medium-font-size": "12px",
  "@tag-large-font-size": "14px",
  "@tag-text-color": "@white",
  "@tag-border-radius": ".2em",
  "@tag-round-border-radius": ".8em",

  // Toast
  "@toast-max-width": "70%",
  "@toast-font-size": "14px",
  "@toast-text-color": "@white",
  "@toast-line-height": "20px",
  "@toast-border-radius": "4px",
  "@toast-background-color": "rgba(@text-color, .88)",
  "@toast-icon-size": "48px",
  "@toast-text-min-width": "96px",
  "@toast-text-padding": "8px 12px",
  "@toast-default-padding": "15px",
  "@toast-default-width": "90px",
  "@toast-default-min-height": "90px",
  "@toast-position-top-distance": "50px",
  "@toast-position-bottom-distance": "50px",

  // Search
  "@search-background-color": "#f7f8fA",

  // Stepper
  "@stepper-active-color": "#e8e8e8",
  "@stepper-background-color": "@active-color",
  "@stepper-button-disabled-color": "#f7f8fa",
  "@stepper-input-disabled-color": "@active-color",
  "@stepper-border-radius": "4px"
};

另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。

文章題目:vue-cli3.0+VantUI搭建移動(dòng)端基礎(chǔ)框架-創(chuàng)新互聯(lián)
本文地址:http://aaarwkj.com/article30/iegpo.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供軟件開發(fā)、網(wǎng)站制作、網(wǎng)站設(shè)計(jì)、用戶體驗(yàn)、品牌網(wǎng)站制作、網(wǎng)站設(shè)計(jì)公司

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

h5響應(yīng)式網(wǎng)站建設(shè)
亚洲成色在线综合剧情网站| 国产男女视频免费观看| av天堂男人站在线观看| 国产极品嫩模在线观看91| 在线观看视频免费午夜| 老湿机午夜十分钟视频| 午夜黄色福利在线观看| 国产欧美日韩精品三级| 亚洲成人免费在线一区| 久久综合午夜福利视频| 亚洲一区欧美二区日韩| 午夜性生活免费在线观看| 婷婷丁香久久五月婷婷| 国产av蜜臀一区二区三区| 可以直接看内射的视频| 亚洲国产欧美日韩久久| 亚洲性感人妻系列网站| 日本黄色录像在线观看| 亚洲精品一区二区三区毛片| 国产亚洲一区二区三区午夜| 九九热99这里有精品| 日韩欧美精品久久黄| 欧美日韩免费高清视视频| 五月激情丁香婷婷色网| 欧美日韩一区二区三区四区高清视频| av中文字幕国产精品| 尤物视频精品在线观看| 麻豆国产传媒片在线观看| 久久人妻精品一区二区三区| 亚洲黄色片成年人免费观看| 另类亚洲欧美专区第一页| 国产日韩亚洲欧美精品专区| 激情av一区二区不卡| 国产美女作爱视频网站| 国产美女主播在线精品一区| 国产精品乱人偷免费视频| 欧美精品欧美精品一区二区| 国产日韩精品激情另类综合| 国产亚洲男人av一区三区| 青青草原综合视频在线| 毛茸茸的阴户在线观看|