随笔分类 - vue
摘要:对于路由多的vue项目,编译时时间会很长 1.安装webpack插件hard-source-webpack-plugin,对模块编译进行缓存 npm install hard-source-webpack-plugin --save-dev 第一次构建时是进行缓存,第二次编译会感觉速度会有很大提升
阅读全文
摘要:在模板文件中引入 <component :is="handleComponent" /> 在js中使用 const handleView = (viewUrl) => import('../' + viewUrl) //引入文件路径 export default { data(){ return {
阅读全文
摘要:// 获取当前时间 /** * 获取当前时间 */ export function getNowTime(str) { const yy = new Date().getFullYear() const MM = (new Date().getMonth() + 1) < 10 ? '0' + (n
阅读全文
摘要:vue 对语法的要求过于严格所以编译的时候报下面这个错误 解决办法: bulid文件夹 webpack.base.conf.js 找到下面的代码:
阅读全文
摘要:货币插件: 价格格式化 // https://github.com/vuejs/vuex/blob/dev/examples/shopping cart/currency.js const digitsRE = /(\d{3})(?=\d)/g / [currency 金额格式化函数] @param
阅读全文