return y + '-' + M + '-' + d + ' ' + h + ':' + m
} else {
return y + '-' + M + '-' + d
}
}
}
export default {
formatTimer
}
main.js引入
import filters from './filters/index'
// 注入全局过滤器
Object.keys(filters).forEach(item => {
Vue.filter(item, filters[item])
})使用
{{1555851774 | formatTimer()}}
vue中使用mock.js
查看我以前写的文章点击我
wepback的可视化资源分析工具插件—webpack-bundle-analyzer
用来分析哪些模块引入了哪些代码,进行有目的性的优化代码
在打包环境中加,使用命令npm run build –report
if (process.env.npm_config_report) {
config.plugins.push(new BundleAnalyzerPlugin())
}
代码地址 项目地址: vue-cli3-H5
demo地址: https://zhouyupeng.github.io/vuecli3H5/#/










