vue-cli2>>>>vue-cli3css
處理pug語法;vue.config.js補充chainWebpackvue
chainWebpack: config => { config.plugins.delete('prefetch'); config.module .rule('pug') .test(/\.pug$/) .use('pug-plain-loader') .loader('pug-plain-loader') .end(); },
todoList:已解決node
蘋方字體抽離webpack
vue首屏渲染方案nginx
wangEditor坑git
xss處理github
CSP,項目被植入miner曠工的外置連接web
i18n國際化處理vue-cli
vue-i18n,vue-cli3可以使用插件,vue add i18n,項目目錄以下json
|-src |-lang |-en.json,zh.json |-page |-abc |-lang.json |-abc.vue
在#app中$i18n.locale判斷語境,新增最外層類名isEN以便對子元素中英切換時的處理
router處理,邏輯是在每次跳轉先將from來源的參數存儲入keysArr,包括lang屬性,排序固定爲?lang=en&a=123&b=456
function nextWithLang() { let queryKeysArr = Object.keys(to.query); // 若是目標地址沒有lang屬性,咱們須要從前一頁取或者默認給一個zh if (!to.query.lang) { let nextPath; // 以前有設置過語言就採用 if (from.query.lang) { nextPath = `${to.path}?lang=${from.query.lang}`; // 將全部屬性拍平接在語言以後,如:/?lang=zh&id=123&name=qqq if (queryKeysArr.length > 0) { queryKeysArr.forEach(key => { if (key != 'lang') { nextPath += `&${key}=${to.query[key]}`; } }); } } // 沒有設置過語言的話就給默認設置一個zh else { nextPath = `${to.path}?lang=zh`; // 將全部屬性拍平接在語言以後,如:/?lang=zh&id=123&name=qqq if (queryKeysArr.length > 0) { queryKeysArr.forEach(key => { if (key != 'lang') { nextPath += `&${key}=${to.query[key]}`; } }); } } next(nextPath); } else { next(); } }
dayjs處理時間戳
postcss.config.js處理低版本瀏覽器前綴
module.exports = { plugins: { "autoprefixer": { browsers: ['ie >= 9', 'last 2 versions',"Firefox >= 30",">2%"] } } }