摘要:Vue 数据冻结 Object.freeze 情景: 页面上常量或者对象不想让修改,只是读取,这时候需要数据冻结 Object.freeze, demo如下 <script> import Vue from 'vue'; export default { data() { return { f33:
阅读全文
摘要:Vue 启动项目内存溢出 FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory 具体信息如下: 95% emitting DONE Compil
阅读全文
摘要:vue 异步更新队列 this.$nextTick(); 解决IE中回显 vue 项目在 IE 中经常遇到回显不出来, 比入有if 判断表单赋值, modal 弹窗赋值, 解决办法: this.isShow = !this.isShow; // 在这样的代码后面使用 this.$nextTick((
阅读全文
摘要:Vue 点击元素变色 <style> .activeClass{ outline: 2px solid #c0c0c0; background-color: #c0c0c0; } </style> <div id="app"> <ul> <li v-for="(item,index) in clas
阅读全文
摘要:vue 中 实现一个简单的 echarts 01) vue 中 实现一个简单的 echarts <template> <div> <div id="charts_1" style="width: 500px;height: 500px;"></div> </div> </template> <scr
阅读全文
摘要:ant-design-vue 之upload 文件上传 01) 单文件上传 使用 :before-upload="beforeUpload" 和 @change="handleChange" <template> <div> <div> 图片名字: {{imgName}}</div> <br /><
阅读全文
摘要:Ant-Design-Vue 隐藏浏览器控制台输出async-validator验证警告 解决办法: node_modules/async-validator/es/util.js 51行node_modules/async-validator/lib/util.js 49行 这2个文件中 cons
阅读全文
摘要:Ant Design Vue 中table表格解析 HTML 场景: 后台返回的数据中有HTML,让前台解析出来 解决方案: 主要使用 scopedSlots 和 slot-scope 和 v-html demo: <template> <div> <h3>解析HTML的p标签</h3> <a-ta
阅读全文
摘要:Ant Design Vue 中重写form表单样式 Ant Design Vue 中form表单样式不符合项目要求,使用全局style重写 主要使用: <style lang="scss"> </style> demo: <template> <div class="study02"> <!--使
阅读全文
摘要:Ant Design Vue 中 modal 利用 $refs 简单使用 主要使用到 this.$refs.closeBtnModal.initShow(); 避免了父组件传值,再使用this.$emit() 的繁琐步骤, 这样可以在子组件中控制modal打开和关闭,不需要在父组件中写代码处理 01
阅读全文
摘要:Ant Design Vue 的 table rowSelection里面去掉全选框 解决办法: columnTitle:' ' 设置为空即可 <a-table :columns="columns" :data-source="data" :customRow="clickRow" :rowKey=
阅读全文
摘要:veu axios 中 async + await 使用 01) 使用 await 等待网路请求返回后,才执行后面其他代码 methods: { // 图书详细 async cliDetail() { console.log("本方法开始执行__",new Date().toLocaleTimeSt
阅读全文
摘要:vue项目中解决文件上传 change事件只执行一次的问题 文件上传第一次上传一个文件后,再次上传这个文件,无法执行change事件, 01) 解决办法,借助v-if 02) 使用 Ant Design Vue 官方的 upload demo: <template> <div> <h3>这里是需求页
阅读全文
摘要:vue-cli 中使用父子之间传值_父组件传值子组件_封装form表单 使用prop属性,(借助v-bind绑定) study01.vue 中代码 <template> <div> <h3>这里是需求页面</h3> <v-form-work ref="form-work" :arrForm="tab
阅读全文
摘要:vue 数组中常见 __ob__: Observer 没有办法循环获取值 解决办法: JSON.parse(JSON.stringify("xxxxxxxObserver"))
阅读全文
摘要:vue-cli 中使用父子之间传值_父组件传值子组件_封装button按钮 使用prop属性,(借助v-bind绑定) study01.vue 中代码 <template> <div> <header-btn @handleSave="handleSave" @handleSubmit="handl
阅读全文
摘要:Ant Design Vue 中 DatePicker 日期选择框 使用 01) 单页面中使用_demo: 新建 test.vue,内容如下 <template> <div> <a-date-picker @change="onChange" :default-value="defaultTime?
阅读全文
摘要:vue 中 meta 元数据使用和页面中title处理,登录login判断处理 router.js 路由文件中设置meta export default new Router({ // mode: 'history', routes: [ { path: '/', name: 'home', met
阅读全文
摘要:slot-scope="scope" 插槽获取当前对象 <el-table :data="tableData" :key="10000" @selection-change="selectChange" style="width: 100%;"> <el-table-column label="详细
阅读全文
摘要:Ant Design 依次提供了三级选项卡,分别用于不同的场景。 卡片式的页签,提供可关闭的样式,常用于容器顶部。 标准线条式页签,用于容器内部的主功能切换,这是最常用的 Tabs。 RadioButton 可作为更次级的页签来使用。 切换的时候绑定点击事件 onTabClick 和改变事件 onC
阅读全文