摘要: import axios from 'axios' axios.defaults.headers.post['Content-Type'] = 'application/json;charset=UTF-8'; axios.defaults.headers.get['Content-Type'] = 阅读全文
posted @ 2020-07-14 19:25 毛栗的demo 阅读(319) 评论(0) 推荐(0)
摘要: // 文件下载 import JSZip from "jszip" import FileSaver from "file-saver" import { post } from 'axios' // 单文件下载 async function singleDownload(url,file) { t 阅读全文
posted @ 2020-07-14 19:08 毛栗的demo 阅读(125) 评论(0) 推荐(0)
摘要: CommonJS规范即AMD:require, exports,module.exports ES6: export / import 遵循规范 require 是 AMD规范引入方式 import是es6的一个语法标准,如果要兼容浏览器的话必须转化成es5的语法 调用时间 require是运行时调 阅读全文
posted @ 2020-07-14 19:06 毛栗的demo 阅读(180) 评论(0) 推荐(0)
摘要: 步骤一,因为打包最终生成的bundle,可能有多个。所以通过如下方式管理输出的资源: module.exports = { entry: { app: './src/index.js', print: './src/print.js' }, output:{ filename: '[name].bu 阅读全文
posted @ 2020-07-14 18:57 毛栗的demo 阅读(681) 评论(0) 推荐(0)
摘要: 前端工程化: 当前前端已由 过去的webPage (一个页面,引些jq插件。。) 转向 webApp,业务逐渐复杂,是一个独立的工程。 因此会产生一些问题: 1,如何进行高效的多人协作。 2,如何保证项目的可维护性 3,如何降低项目的生产风险:打包,部署。 可以从如下四方面理解: a,模块化,组件化 阅读全文
posted @ 2020-07-14 18:52 毛栗的demo 阅读(372) 评论(0) 推荐(0)