简单粗暴的解决内存泄漏问题 Vue.mixin({ destroyed() { // 混入释放资源,解决内存泄漏问题 this._watcher = null; this._watchers = null; this.$options = null; this._computedWatchers = null; this.$vnode = null; this.$children = null; this._vnode = null; this._props
Ant Design组件table key 问题 没有设置的key时,会出现以下警告Warning: [antd: Table] Each record in dataSource of table should have a unique `key` prop, or set `rowKey` of Table to an unique primary key设置key<a-table bordered :columns="columns" :data-source="tableData" :
vue.use()与vue.install() 关于vue.use()与vue.install()vue官方文档官网是这样写的:https://cn.vuejs.org/v2/guide/plugins.html应用可对http进行一下封装将get 和post 方法作为vue 的实例方法const createHttpPlugin = () => { return { install(Vue) { Vue.prototype.$post = axios.post; Vue.prototype.$get
json与xml互相转化问题、插件fast-xml-parser 使用插件: fast-xml-parser使用说明:https://www.npmjs.com/package/fast-xml-parserjson转xmlvar Parser = require("fast-xml-parser").j2xParser;//default options need not to setvar options = { attributeNamePrefix : "@_", attrNodeName: "@", //default is false
白屏问题--热更新(vue.config.js配置)-form表单(ant) 由于登录后,将用户信息写入到本地文件,导致项目热更新,因此导致白屏问题,解决方案:在vue.config.js配置文件中 ,设置忽略此文件 resolve(’./electronStore.json’) devServer: { watchOptions: { ignored: ['**/node_modules', resolve('./public'), resolve('./projects'), resolve('./electronStore.json')], }