摘要: <Form ref="invoiceDom"></Form> 1.this.$refs['invoiceDOM'] 2.this.$refs.invoiceDOM 3.this.$refs.invoiceDOM.$el//(组件获取不到时可以尝试用这种方式) 阅读全文
posted @ 2020-12-22 14:17 苏小白啊 阅读(372) 评论(0) 推荐(0) 编辑
摘要: 1.Array.from Array.from方法用于将两类对象转为真正的数组:类似数组的对象(array-like object)和可遍历(iterable)的对象(包括 ES6 新增的数据结构 Set 和 Map)。 下面是一个类似数组的对象,Array.from将它转为真正的数组。 let a 阅读全文
posted @ 2020-12-15 16:18 苏小白啊 阅读(144) 评论(0) 推荐(0) 编辑
摘要: let date = 2020-11-12 03:20:10 date = date | formatDate // 2020-11-12 阅读全文
posted @ 2020-11-23 13:34 苏小白啊 阅读(226) 评论(0) 推荐(0) 编辑
摘要: <div ref="content"> <div ref="header"></div> <div class="tabs_panel" :style="{height: `${billingHeight}px`}" style="overflow: auto" :class="[isEdit?'c 阅读全文
posted @ 2020-11-19 18:11 苏小白啊 阅读(2419) 评论(0) 推荐(0) 编辑
摘要: 1.创建一个vue实例 bus.js import Vue from 'vue' export default new Vue() 1. b.vue传值给a.vue a.vue import Bus from '@/libs/bus.js' //调用 Bus.$emit('selectionSamp 阅读全文
posted @ 2020-09-22 10:36 苏小白啊 阅读(2941) 评论(0) 推荐(0) 编辑
摘要: //背景色打印不出来 @media print { .iconClass { background: black !important; -webkit-print-color-adjust: exact; } } //伪类打印不出来 当前页重新css伪类编辑 <style lang="less"> 阅读全文
posted @ 2020-09-05 17:27 苏小白啊 阅读(761) 评论(0) 推荐(0) 编辑
摘要: filter去重首先要清楚在数组中indexOf的含义 indexOf()方法返回在数组中可以找到一个给定元素的第一个索引,如果不存在,则返回-1。 1.简单数据类型去重 let arr = ['a', 'b', 'c', 'c', 'd', 'd'] let outPut = arr.filter 阅读全文
posted @ 2020-08-29 10:48 苏小白啊 阅读(5000) 评论(1) 推荐(1) 编辑
摘要: eg: let tableData=[{name:'小明',age:'12'},{name:'小红',age:'11'}] //遍历数组对象增加属性 index 如果直接遍历的话对象会有__ob__: Observer属性,这些数据是vue这个框架对数据设置的监控器,一般都是不可枚举的,因此要转换下 阅读全文
posted @ 2020-08-24 11:23 苏小白啊 阅读(2436) 评论(0) 推荐(0) 编辑
摘要: data() { return { //值 tableData :[] } } methods: { init() { this.tableData = [] }, } watch:{ //监听tableData值变化, tableData (newVal, oldVal) { newVal.for 阅读全文
posted @ 2020-08-06 15:43 苏小白啊 阅读(1350) 评论(0) 推荐(0) 编辑
摘要: let array=[1,2,5,4,1,2] array.forEach((ele,index)=> { if(array.indexOf(ele) !== index){ console.log(ele) } }) 阅读全文
posted @ 2020-07-22 17:37 苏小白啊 阅读(383) 评论(0) 推荐(0) 编辑