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%"] } } }