10 2022 档案
摘要:应用场景 页面在接口请求到html模板后动态的向模板中挂载dom (例如 获得准考证的html模版后需要添加考试科目表格,#subject-table为模板预留占位标签) 注:全局组件可在页面内直接使用组件名标签使用 通过Vue.component注册全局组件 通过Vue.extend创建构造器 创
阅读全文
摘要:1. 声明和初始化数组 const array = Array(5).fill(''); // 输出 (5) ["", "", "", "", ""] const matrix = Array(5).fill(0).map(()=>Array(5).fill(0)); // 输出 (5) [Arra
阅读全文
摘要:print () { this.printLoading = true const dom = document.querySelector('#printBox') // 添加延时器以解决loading 效果失效的问题 setTimeout(() => { this.$print(dom) },
阅读全文
摘要:注意innerHTM必须换行书写 export function setStyle (direction) { const styleNode = document.createElement('style') styleNode.setAttribute('id', 'print-style')
阅读全文
摘要:使用chainWebpack配置TerserWebpackPlugin插件 安装插件版本要和webpack的版本匹配 npm install terser-webpack-plugin --save-dev chainWebpack(config) { config .when(process.en
阅读全文