Vue父组件调用子组件的方法并传参的两种方式(用$refs.refName.functionName、window.function) is a project mainly written in , based on the . 如需了解儿子怎么控制老子的,传送门:https://s-z-q.blog.csdn.net/article/details/120094689
父组件father.vue
Vue 监听路由变化的三种方式 is a project mainly written in , based on the .方法一:通过 watch // 监听,当路由发生变化的时候执行 watch:{$route(to,from){console.log(to.path);} }, 或 // 监听,当路由发生变化的时候执行 watch: {$route: {handler: function(val, oldVal){console.log...
封装echarts china map geo实现dispatch触发geoSelect事件高亮显示某个省份和城市,并定义复杂样式 is a project mainly written in , based on the .实现如下效果
用echarts geo类型的中国地图封装vue组件,具体的地图信息china.json传送门https://blog.csdn.net/qq_37860634/article/details/119854379
设置VSCode快捷键Alt+U(首字母转换为大写)、Shift+Alt+U(全部转换为大写)、Shift+Alt+L(全部转换为小写) is a project mainly written in , based on the . 等同于 'aaa'.replace(/^./,'aaa'.slice(0,1).toUpperCase()); //Aaa aaa'.toUpperCase(); //AAA 等同于 'AAA'.toLowerCase(); //aaa...
原生CSS设置预加载图片之前的默认背景图 is a project mainly written in , based on the ./*默认加载图片*/ .class-name { /*背景图片*/background: url(../../img/banner/banner-default.jpg) no-repeat center bottom;width: 100%;height: 861px; } .class-name:after { /*默认加载背景图...
【冷知识】获取网页所有的监听事件类型、方法。请认准getEventListeners is a project mainly written in , based on the . 获取事件列表 getEventListeners(window)//获取window绑定的所有监听事件列表//----------------------------------------getEventListeners(document.querySelector("选择器"))//获取指定DOM的所有监听事件...
【全网最精简】一行代码解决千万位以上的数字格式化为银行金额数字格式(如:¥1,000,000,000.00) is a project mainly written in , based on the .parseFloat(123456789.123456.toFixed(2)).toLocaleString(); //"123,456,789.12"(注意输出的是字符串)parseFloat(parseFloat("123456789.123456").toFixed(2)).toLocaleString(); //转换字符串格式...
Linux CentOS 6+复制本地前端文件压缩包解压到服务器端指定目录 is a project mainly written in , based on the .mv /tmp/admin.zip /usr/data/apache-tomcat-7.0.82_80/webapps/xxx/admincd /usr/data/apache-tomcat-7.0.82_80/webapps/xxx/adminunzip admin.ziprm –rf 被删除的文件或者文件夹名称mkdir 将被创建...
Echarts 横纵分割线颜色透明度 is a project mainly written in , based on the . /*横纵分割线颜色透明度*/ xAxis: {axisLabel: {textStyle: {color: "#2484db"}},axisLine: {lineStyle: {color: 'rgba(0,2,85,1)',width: 2,}},splitLine: {show: true,lineStyle: {colo...
Echarts横坐标文字太长显示不完的两种解决办法:rotate旋转文字、调用函数让文字纵向排列 is a project mainly written in , based on the .//方法1:横坐标文字太长显示不完,调用函数解决,在axisLabel下添加属性,让文字纵向排列: formatter:function(val){return val.split("").join(" "); }//方法2:旋转横坐标文字 xAxis: {axisLabel: {rotate: 30, //文字旋转}, },...
百度热力图 is a project mainly written in , based on the .var SGheadMapPoints = {/*obj={ maxLng: minLng: maxLat: minLat: maxCount:最大人数 minCount:最小人数 total:点位数量 }*/get: function (obj) {var arr = [];obj.maxCount || (obj.maxCount...
一行CSS样式去除百度地图版权,去除百度地图右上角平移缩放控件的市县区文字 is a project mainly written in , based on the ./*去除百度地图版权,去除百度地图右上角平移缩放控件的市县区文字*/ .anchorBL, .BMap_zlHolder {display: none;visibility: hidden;}...
设置echarts的grid、tooltip、柱状图渐变色、折线图渐变色 is a project mainly written in , based on the .grid: {show: false,left: '0px',top: '50px',right: '1px',bottom: '0px',containLabel: true,backgroundColor: 'white',//show: true的时候才显示borderColor: '#ccc',borderWidth: 1,/...
覆盖半透明黑色CSS,通常用于弹窗提示、弹窗显示大图等情况的背景图层 is a project mainly written in , based on the ./*覆盖半透明黑色*/ :after { /*父元素需要 position: relative;*/content: '';background: rgba(0, 0, 0, 0.38);position: absolute;left: 0;top: 0;width: 100%;height: 100%; }...
【最精简写法】获取一维数组和对象数组最值:最大值、最小值,返回对象 is a project mainly written in , based on the .Math.max(...arr);//返回数组最大值 Math.min(...arr);//返回数组最小值Math.max(...objArr.map(o => o.最值字段名));//返回对象数组最大值 Math.min(...objArr.map(o => o.最值字段名));//返回对象数组最小值objArr.sort((pre...
【ES6新特性】一行代码解决:搜索对象数组,匹配具体字段属性值的返回值和索引的问题 is a project mainly written in , based on the .arr.find(v => v.key == "需要搜索的值") //返回搜索匹配字段属性值的对象arr.findIndex(v => v.key == "需要搜索的值") //返回匹配项的索引值...
JavaScript的Array一些非常规玩法 is a project mainly written in , based on the .[{name:1},{name:2}].forEach((v,i,ar) => {console.log(v,i,ar)});//基础遍历[{name:1},{name:2}].map((v) => v.name);//[1,2]返回对象数组中指定字段值的一位数组(不改变原始数组)[{name:1},{name:2},{name:3}...
将Nodelist快速转换为Array数组 is a project mainly written in , based on the .Array.prototype.slice.call(document.querySelectorAll("div"))或[].slice.call(document.querySelectorAll("div")) //推荐这个写法,简练...
Sd.js 2.0封装:更加简化请求传参内容 is a project mainly written in , based on the .sd.js import $global from "./global"; import $g from "./sg"; import $ from "jquery"; import {Message, Loading} from "element-ui";//引入饿了么相关组件 import {Base64} from "js-...
Vue子组件调用父组件方法并传参的5种方式:$emit触发、传入子组件function、访问父组件$parent.function、用inject关联父组件prov is a project mainly written in , based on the . 如需了解老子怎么控制儿子的,传送门:https://s-z-q.blog.csdn.net/article/details/119922715
子组件child.vue