<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[she8362315的博客]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/she8362315</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; she8362315]]></copyright><item><title><![CDATA[处理setInterval造成的浏览器内存溢出]]></title><link>https://blog.youkuaiyun.com/she8362315/article/details/119862154</link><guid>https://blog.youkuaiyun.com/she8362315/article/details/119862154</guid><author>she8362315</author><pubDate>Mon, 23 Aug 2021 09:36:53 +0800</pubDate><description><![CDATA[起因
最近的一个vue项目要求页面5秒一次实时请求数据, 最开始考虑的是建立websocket长连接进行通信,但是在数据量较大时socket链接会自动断开,后台也没有找到解决办法,最后决定由前端发送定时请求, 但是在使用过程中出现了长时间挂机页面会出现浏览器崩溃的情况

后经过测试是setInterval方法造成的(原因没有搞懂)
解决方案
使用requestAnimationFrame方法代替setInterval进行实时请求
export function RAFInit () {
  let RAF ]]></description><category></category></item><item><title><![CDATA[css写一个简单的方向操作]]></title><link>https://blog.youkuaiyun.com/she8362315/article/details/114969946</link><guid>https://blog.youkuaiyun.com/she8362315/article/details/114969946</guid><author>she8362315</author><pubDate>Thu, 18 Mar 2021 11:25:55 +0800</pubDate><description><![CDATA[效果:
![在这里插入图片描述](https://img-blog.csdnimg.cn/20210318112456360.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3NoZTgzNjIzMTU=,size_16,color_FFFFFF,t_70#pic_center)


// html
&lt;div class="btnBox"&gt;]]></description><category></category></item><item><title><![CDATA[全屏组件(支持局部全屏)]]></title><link>https://blog.youkuaiyun.com/she8362315/article/details/108854595</link><guid>https://blog.youkuaiyun.com/she8362315/article/details/108854595</guid><author>she8362315</author><pubDate>Mon, 28 Sep 2020 17:59:14 +0800</pubDate><description><![CDATA[安装
npm install vue-fullscreen

使用

&lt;template&gt;
  &lt;div id="app"&gt;
    &lt;fullscreen :fullscreen.sync="fullscreenType"&gt;
      &lt;div&gt;需要全屏的内容&lt;/div&gt;
    &lt;/fullscreen&gt;
    &lt;button type="button" @click="fullscreenTypeChange" &gt;]]></description><category></category></item><item><title><![CDATA[横向滚动组件]]></title><link>https://blog.youkuaiyun.com/she8362315/article/details/108165685</link><guid>https://blog.youkuaiyun.com/she8362315/article/details/108165685</guid><author>she8362315</author><pubDate>Sat, 22 Aug 2020 11:21:49 +0800</pubDate><description><![CDATA[&lt;template&gt;
  &lt;div class="inherentRiskBox"&gt;
    &lt;div class="titleBox"&gt;
      &lt;div class="searchBox"&gt;
        &lt;el-date-picker
          v-model="startTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeh.]]></description><category></category></item><item><title><![CDATA[百度聚合卡顿解决代码]]></title><link>https://blog.youkuaiyun.com/she8362315/article/details/108106038</link><guid>https://blog.youkuaiyun.com/she8362315/article/details/108106038</guid><author>she8362315</author><pubDate>Wed, 19 Aug 2020 17:33:09 +0800</pubDate><description><![CDATA[修改MarkerClusterer.js
有兴趣的可以研究一下,不想研究的直接贴吧
/**
 * @fileoverview MarkerClusterer标记聚合器用来解决加载大量点要素到地图上产生覆盖现象的问题，并提高性能。
 * 主入口类是&lt;a href="symbols/BMapLib.MarkerClusterer.html"&gt;MarkerClusterer&lt;/a&gt;，
 * 基于Baidu Map API 1.2。
 *
 * @author Baidu Map Api G]]></description><category></category></item><item><title><![CDATA[修改百度地图点聚合点击事件获取markers数据]]></title><link>https://blog.youkuaiyun.com/she8362315/article/details/107977822</link><guid>https://blog.youkuaiyun.com/she8362315/article/details/107977822</guid><author>she8362315</author><pubDate>Thu, 13 Aug 2020 13:54:09 +0800</pubDate><description><![CDATA[百度聚合点击事件(需要修改MarkerClusterer.js)
this._clusterMarker.addEventListener('click', function (event) {
   thatMap.setViewport(thatBounds); // 放大地图
 });

为marker添加自定义属性
let marker = new BMap.Marker(new BMap.Point(lng, lat))
marker.customData = { name: 'xxx', num]]></description><category></category></item><item><title><![CDATA[前端获取省市区镇数据]]></title><link>https://blog.youkuaiyun.com/she8362315/article/details/107711606</link><guid>https://blog.youkuaiyun.com/she8362315/article/details/107711606</guid><author>she8362315</author><pubDate>Fri, 31 Jul 2020 13:46:04 +0800</pubDate><description><![CDATA[自动生成省市区镇四级联动数据

]]></description><category></category></item><item><title><![CDATA[笔记]]></title><link>https://blog.youkuaiyun.com/she8362315/article/details/107400929</link><guid>https://blog.youkuaiyun.com/she8362315/article/details/107400929</guid><author>she8362315</author><pubDate>Fri, 17 Jul 2020 09:42:58 +0800</pubDate><description><![CDATA[this.fuxin(this.treeData, this.checkedKeys) // checkedKeys: [1,2,3,4,5]  treeData为一个树形结构数据
this.xunfu(this.treeData, arr) // arr: [1,2,3,4,5]
xunfu (tree, groupIds, idf) { // 有部分子级添加父级id
      tree.map(res =&gt; {
        if (res.hasChildren &amp;&amp; !id]]></description><category></category></item><item><title><![CDATA[BD-09转GCJ-02在转WGS84在转web墨卡托]]></title><link>https://blog.youkuaiyun.com/she8362315/article/details/107315964</link><guid>https://blog.youkuaiyun.com/she8362315/article/details/107315964</guid><author>she8362315</author><pubDate>Mon, 13 Jul 2020 14:10:31 +0800</pubDate><description><![CDATA[bd09togcj02 (lng, lat) { // BD-09-&gt;GCJ-02
      console.log(lng, lat, '百度')
      let xPI = 3.14159265358979324 * 3000.0 / 180.0;
      let x = lng - 0.0065;
      let y = lat - 0.006;
      let z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * xPI)]]></description><category></category></item><item><title><![CDATA[百度地图仅拉框封装]]></title><link>https://blog.youkuaiyun.com/she8362315/article/details/106856924</link><guid>https://blog.youkuaiyun.com/she8362315/article/details/106856924</guid><author>she8362315</author><pubDate>Fri, 19 Jun 2020 15:15:29 +0800</pubDate><description><![CDATA[在最近的项目中有需求需要拉框搜索区域内的一些特定信息
在百度上找到的参考有拉框放大和拉框搜索二个，但是都是封装好的，它们并不会返回拉框区域的坐标，所以我也无法使用，最后只能把拉框部分抽出来自己做个记录
&lt;!DOCTYPE html&gt;
&lt;html&gt;

&lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
  &lt;title&gt;拉框&lt;/title&]]></description><category></category></item><item><title><![CDATA[vue使用socket.io]]></title><link>https://blog.youkuaiyun.com/she8362315/article/details/106823564</link><guid>https://blog.youkuaiyun.com/she8362315/article/details/106823564</guid><author>she8362315</author><pubDate>Thu, 18 Jun 2020 09:33:10 +0800</pubDate><description><![CDATA[安装
npm install vue-socket.io --save

引用
import io from 'socket.io-client'

建立链接
initWebSocket () {
      this.socket = null
      this.socket = io.connect('http://localhost:5000', {
        timeout: 300000,
        reconnectionDelayMax: 1000,
        recon]]></description><category></category></item><item><title><![CDATA[IE中一些特定的数字或IP地址会变成点击按钮处理]]></title><link>https://blog.youkuaiyun.com/she8362315/article/details/106633846</link><guid>https://blog.youkuaiyun.com/she8362315/article/details/106633846</guid><author>she8362315</author><pubDate>Tue, 09 Jun 2020 09:20:35 +0800</pubDate><description><![CDATA[现象：在展示这些数据时，在IE浏览器中数据本身会变成可点击的状态
解决方案：使用a标签包裹并禁止点击
&lt;a style="color: #000;text-decoration: none;" disabled="disabled"&gt;23.135.2.255&lt;/a&gt;



]]></description><category></category></item><item><title><![CDATA[数组合并,并去重]]></title><link>https://blog.youkuaiyun.com/she8362315/article/details/102949792</link><guid>https://blog.youkuaiyun.com/she8362315/article/details/102949792</guid><author>she8362315</author><pubDate>Thu, 07 Nov 2019 10:43:23 +0800</pubDate><description><![CDATA[let a = [1,2,3,4,5]
let b = [4,5,6,7,8]
let c = new Set([...a,...b])
console.log(c) // [1,2,3,4,5,6,7,8]


]]></description><category></category></item><item><title><![CDATA[数组去重]]></title><link>https://blog.youkuaiyun.com/she8362315/article/details/102948526</link><guid>https://blog.youkuaiyun.com/she8362315/article/details/102948526</guid><author>she8362315</author><pubDate>Thu, 07 Nov 2019 10:08:07 +0800</pubDate><description><![CDATA[虽然有多种实现方式,但是考虑到性能的问题我个人只记录两种
1. new Set()
function duplicateRemoval(a, b) {
    return Array.from(new Set([...a, ...b]))
}

2. for…of + Object
function duplicateRemoval(a, b) {
    let arr = a.concat(...]]></description><category></category></item><item><title><![CDATA[总结的一些元素居中的方法]]></title><link>https://blog.youkuaiyun.com/she8362315/article/details/102890863</link><guid>https://blog.youkuaiyun.com/she8362315/article/details/102890863</guid><author>she8362315</author><pubDate>Tue, 05 Nov 2019 11:36:58 +0800</pubDate><description><![CDATA[1.定长定宽
1.1绝对定位和负magin值
HTML:
&lt;div class="father-box"&gt;
  &lt;div class="children-box"&gt;&lt;/div&gt;
&lt;/div&gt;
CSS:
.father-box {
    width: 200px;
    height: 200px;
    border: 1px solid re...]]></description><category></category></item><item><title><![CDATA[VUE点击复制组件]]></title><link>https://blog.youkuaiyun.com/she8362315/article/details/102719158</link><guid>https://blog.youkuaiyun.com/she8362315/article/details/102719158</guid><author>she8362315</author><pubDate>Thu, 24 Oct 2019 11:13:32 +0800</pubDate><description><![CDATA[1.安装依赖
    npm install --save v-clipboard
     
    2.在main.js中引入
    import Vue from 'vue'
    import Clipboard from 'v-clipboard'
    Vue.use(Clipboard)
     
    3.Html
    &lt;template&gt;
   ...]]></description><category></category></item><item><title><![CDATA[CSS pre中josn超出宽度自动换行]]></title><link>https://blog.youkuaiyun.com/she8362315/article/details/102542215</link><guid>https://blog.youkuaiyun.com/she8362315/article/details/102542215</guid><author>she8362315</author><pubDate>Mon, 14 Oct 2019 09:54:46 +0800</pubDate><description><![CDATA[{
	word-break: break-all; // 按字符截断换行 /* 支持IE和chrome，FF不支持*/
	word-wrap:break-word; // 按英文单词整体截断换行  /* 以上三个浏览器均支持 */
	white-space: pre-wrap;
}


...]]></description><category></category></item><item><title><![CDATA[list新增删除Key:Value]]></title><link>https://blog.youkuaiyun.com/she8362315/article/details/100517897</link><guid>https://blog.youkuaiyun.com/she8362315/article/details/100517897</guid><author>she8362315</author><pubDate>Tue, 03 Sep 2019 14:48:34 +0800</pubDate><description><![CDATA[向一个对象数组里面添加新的属性
var arr = [{a:'我是a',b:我是b,c:'我是c',d:'我是d'},{a:'我是a',b:我是b,c:'我是c',d:'我是d'},{a:'我是a',b:我是b,c:'我是c',d:'我是d'}]
var arr2=[]
arr.map((item, index)=&gt; { 
	arr2.push(Object.assign({},item,{...]]></description><category></category></item><item><title><![CDATA[自用型小数转换百分比保留二位小数(处理浮点数可能)]]></title><link>https://blog.youkuaiyun.com/she8362315/article/details/93174491</link><guid>https://blog.youkuaiyun.com/she8362315/article/details/93174491</guid><author>she8362315</author><pubDate>Fri, 21 Jun 2019 11:12:41 +0800</pubDate><description><![CDATA[let formateRate = function(num) {
  if (typeof num !== 'number') return num
  let result = (num * 100).toFixed(2)
  if (result.toString().split('.').length &gt; 1) {
    result = parseFloat(
      res...]]></description><category></category></item><item><title><![CDATA[超出部分显示指定行数隐藏显示省略号]]></title><link>https://blog.youkuaiyun.com/she8362315/article/details/92128540</link><guid>https://blog.youkuaiyun.com/she8362315/article/details/92128540</guid><author>she8362315</author><pubDate>Sat, 15 Jun 2019 17:43:58 +0800</pubDate><description><![CDATA[{
 	 overflow: hidden;
 	 text-overflow: ellipsis;
  	 display: -webkit-box;
  	 -webkit-line-clamp: 3; // 指定显示的行数
  	 -webkit-box-orient: vertical;
}


]]></description><category></category></item></channel></rss>