<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[shu580231的博客]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/shu580231</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; shu580231]]></copyright><item><title><![CDATA[reduce/some/filter/map/every等方法]]></title><link>https://blog.youkuaiyun.com/shu580231/article/details/89459637</link><guid>https://blog.youkuaiyun.com/shu580231/article/details/89459637</guid><author>shu580231</author><pubDate>Tue, 23 Apr 2019 09:09:35 +0800</pubDate><description><![CDATA[1.reduce--让数组中的前项和后项做某种计算，并累计最终值


let arr = [1,2,3,4,5];
let result = arr.reduce((prev, cur, index, arr)=&gt; {
    return prev + cur;
});//15

var result = [
    {
        subject: 'math',
        s...]]></description><category></category></item><item><title><![CDATA[dataTables--保留相关操作]]></title><link>https://blog.youkuaiyun.com/shu580231/article/details/86300464</link><guid>https://blog.youkuaiyun.com/shu580231/article/details/86300464</guid><author>shu580231</author><pubDate>Fri, 11 Jan 2019 14:58:22 +0800</pubDate><description><![CDATA[主要解释保留表格的操作记录---

1.bStateSave(属性设置)---状态保存, 再次加载页面时还原表格状态。

2.$(&quot;#tableId&quot;).DataTable().draw(false);--也会刷新表格，但是会保留我们的操作状态。

3.跳转到指定页---

const Table = $(&quot;#table&quot;).DataTable();  
Table.page(number).dr...]]></description><category></category></item><item><title><![CDATA[设置object的key为变量]]></title><link>https://blog.youkuaiyun.com/shu580231/article/details/81367271</link><guid>https://blog.youkuaiyun.com/shu580231/article/details/81367271</guid><author>shu580231</author><pubDate>Thu, 02 Aug 2018 20:44:34 +0800</pubDate><description><![CDATA[我们首先把这个object变为字符串，然后再把字符串转为对象。

var a = 12;

var str  = '{'+a+' : &quot;123&quot;}'

var obj = eval(&quot;(&quot;+str+&quot;)&quot;);

得到结果：

obj = {12: &quot;123&quot;}

更新………………………………………………………………………………………………

let a = 'helloWorld',let b =...]]></description><category></category></item><item><title><![CDATA[vue element中引入阿里巴巴矢量图标库]]></title><link>https://blog.youkuaiyun.com/shu580231/article/details/81098412</link><guid>https://blog.youkuaiyun.com/shu580231/article/details/81098412</guid><author>shu580231</author><pubDate>Wed, 18 Jul 2018 15:10:50 +0800</pubDate><description><![CDATA[选择好自己想要的图标加入购物车，添加至自己的某一个项目中。

⚠️在更多操作中，我们需要对项目进行一个编辑。



这里的设置主要是为了不和element的图标冲突。然后下载到本地之后，放在src／assets下。在iconfont.css中进行修改。

增加一段如图所示的代码：


[class^=&quot;el-icon-ump&quot;], [class*=&quot; el-icon-ump&quot;] {
  font-...]]></description><category></category></item><item><title><![CDATA[使用css实现一个正方形]]></title><link>https://blog.youkuaiyun.com/shu580231/article/details/80889147</link><guid>https://blog.youkuaiyun.com/shu580231/article/details/80889147</guid><author>shu580231</author><pubDate>Mon, 02 Jul 2018 20:34:40 +0800</pubDate><description><![CDATA[    很多情况下，在移动端的设计里，会出现要求图片等高等宽，而图片的宽度又是随着不同的移动设备进行改变的，这个时候就需要用到正方形的一个实现。&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
	&amp;lt;head&amp;gt;
		&amp;lt;meta charset=&quot;utf-8&quot;&amp;gt;
		&amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;
		&amp;lt;style ]]></description><category></category></item><item><title><![CDATA[npm 报错 Module build failed: Error: No PostCSS Config found in]]></title><link>https://blog.youkuaiyun.com/shu580231/article/details/80839589</link><guid>https://blog.youkuaiyun.com/shu580231/article/details/80839589</guid><author>shu580231</author><pubDate>Thu, 28 Jun 2018 10:39:31 +0800</pubDate><description><![CDATA[用vue-cli创建的本地项目，本地运行OK。然后换了一个目录，把除了依赖之外的目录全拷贝过去了，但是在npm run dev的时候就报这样的错了。fix：在根目录下建一个文件，postcss.config.js。添加代码：module.exports = { 
  plugins: { 
    'autoprefixer': {browsers: 'last 5 version'} 
  } ...]]></description><category></category></item><item><title><![CDATA[vue-cli创建项目设置跨域请求]]></title><link>https://blog.youkuaiyun.com/shu580231/article/details/80835040</link><guid>https://blog.youkuaiyun.com/shu580231/article/details/80835040</guid><author>shu580231</author><pubDate>Wed, 27 Jun 2018 21:23:20 +0800</pubDate><description><![CDATA[    为什么用vue-cli创建之后的项目调用后台接口会出现跨域的问题。直接调去后台接口就会出现404。是因为vue的localhost与访问域名不一致，导致的跨域问题。所以在这里就用到了代理，也就是代理服务器-Proxy Server，也就是网络信息的中转站。设置代理：在config／index.js中，找到dev:{}, 在这里面设置一个proxyTabledev: {
    // Pat...]]></description><category></category></item><item><title><![CDATA[数据用二进制占位符交互]]></title><link>https://blog.youkuaiyun.com/shu580231/article/details/80623803</link><guid>https://blog.youkuaiyun.com/shu580231/article/details/80623803</guid><author>shu580231</author><pubDate>Fri, 08 Jun 2018 15:32:47 +0800</pubDate><description><![CDATA[如图所示：这个一个多选框，每个option对应的值为：&amp;lt;option value=“2&quot;&amp;gt;a&amp;lt;/option&amp;gt;&amp;lt;option value=“4&quot;&amp;gt;b&amp;lt;/option&amp;gt;&amp;lt;option value=“8&quot;&amp;gt;c&amp;lt;/option&amp;gt;&amp;lt;option value=“16&quot;&amp;gt;d&amp;lt]]></description><category></category></item><item><title><![CDATA[前端实现复制功能]]></title><link>https://blog.youkuaiyun.com/shu580231/article/details/80584650</link><guid>https://blog.youkuaiyun.com/shu580231/article/details/80584650</guid><author>shu580231</author><pubDate>Tue, 05 Jun 2018 18:53:29 +0800</pubDate><description><![CDATA[很多情况下，前端可能会遇到实现复制的功能。这里用的方法是target.find('input').select();
var flag = document.execCommand(&quot;Cut&quot;,&quot;false&quot;,null);//剪切 var flag = document.execCommand(&quot;Cut&quot;,&quot;false&quot;,null);／／复制其中flag为true的时候，代表复制成功。⚠️：1.有...]]></description><category></category></item><item><title><![CDATA[如何准确的区分对象和数组]]></title><link>https://blog.youkuaiyun.com/shu580231/article/details/80501889</link><guid>https://blog.youkuaiyun.com/shu580231/article/details/80501889</guid><author>shu580231</author><pubDate>Tue, 29 May 2018 21:05:44 +0800</pubDate><description><![CDATA[前言--我们可能会经常用到typeof去判断某一个变量的类型。但是如图所示typeof对于区分数组和对象是没有用的。方法一：Array.isArray()。。。var a = [1,2,4];
var b= {&quot;name&quot;:&quot;lsx&quot;};
console.log(Array.isArray(a)) //true
console.log(Array.isArray(b)) //false方法二：co...]]></description><category></category></item><item><title><![CDATA[select2 option 设置disabled以及如何取消disabled属性]]></title><link>https://blog.youkuaiyun.com/shu580231/article/details/80340207</link><guid>https://blog.youkuaiyun.com/shu580231/article/details/80340207</guid><author>shu580231</author><pubDate>Wed, 16 May 2018 17:37:58 +0800</pubDate><description><![CDATA[select2使用不久，最近遇到一个问题，需要对某一个option设置为不可选，但是一些操作之后恢复可选状态。1.设置为不可选状态，很容易， $(&quot;#single_select option[value='b']&quot;).prop('disabled',true); $(&quot;#single_select&quot;).select2();2.取消option的disabled属性。2.1 $(&quot;#single_s...]]></description><category></category></item><item><title><![CDATA[vue平行组件之间的通信]]></title><link>https://blog.youkuaiyun.com/shu580231/article/details/80251261</link><guid>https://blog.youkuaiyun.com/shu580231/article/details/80251261</guid><author>shu580231</author><pubDate>Wed, 09 May 2018 11:39:56 +0800</pubDate><description><![CDATA[平行组件之间的通信，需要借助一个空的vue对象。var Event = new Vue();发送依旧是用Event.$emit('自己定义的事件','需要发送的数据')，接收的时候，需要在钩子函数mounted中接收，用Event.$on('相对应的事件',回调函数function(msg){});发送数据：接收数据:...]]></description><category></category></item><item><title><![CDATA[vue父组件和子组件之间的通信]]></title><link>https://blog.youkuaiyun.com/shu580231/article/details/80249826</link><guid>https://blog.youkuaiyun.com/shu580231/article/details/80249826</guid><author>shu580231</author><pubDate>Wed, 09 May 2018 10:37:31 +0800</pubDate><description><![CDATA[1.父组件传递数据给子组件。    原理：将父组件的值作为一个属性，绑定给子组件，在子组件中通过props进行接收。其中props接收的方式有3种：    1.props:['name']  2.props:{name:{type:String}}    3.props:{name:String}2.子组件跟父组件之间的通信    原理：子组件需要利用一个$emit('声明的事件','需要发送的值...]]></description><category></category></item><item><title><![CDATA[小标题自适应的经典布局--flex]]></title><link>https://blog.youkuaiyun.com/shu580231/article/details/80198064</link><guid>https://blog.youkuaiyun.com/shu580231/article/details/80198064</guid><author>shu580231</author><pubDate>Fri, 04 May 2018 18:48:33 +0800</pubDate><description><![CDATA[实现如图所以的小标题布局。实现的注意点：1.两边的线是自适应的，不能写死。如果屏幕大，则留白超级大。否则，线可能就挨着边了。2.因为后面的北京是图片，所以不能用一个div盖在线上。我的实现的方法：&amp;lt;div class=&quot;title&quot;&amp;gt;
  &amp;lt;div class=&quot;line&quot;&amp;gt;&amp;lt;/div&amp;gt;
  &amp;lt;div class=&quot;text&quot;&amp;gt;优惠信息&]]></description><category></category></item><item><title><![CDATA[filter---的各种值]]></title><link>https://blog.youkuaiyun.com/shu580231/article/details/80186423</link><guid>https://blog.youkuaiyun.com/shu580231/article/details/80186423</guid><author>shu580231</author><pubDate>Thu, 03 May 2018 21:01:47 +0800</pubDate><description><![CDATA[之前只用过filter的opacity，竟然不知道filter还有很多的值，可以在我们的项目中设置使用。下面将会使用图片➕属性值的方式介绍filter。1.none。。默认值，没有效果。2.blur。。给图像设置高斯模糊。&quot;radius&quot;一值设定高斯函数的标准差，或者是屏幕上以多少像素融在一起， 所以值越大越模糊；---filter:blur(10px);3.brightness(%)。。给图片应...]]></description><category></category></item><item><title><![CDATA[vue-cli的项目中把localhost换成自己的ip无法访问]]></title><link>https://blog.youkuaiyun.com/shu580231/article/details/80176656</link><guid>https://blog.youkuaiyun.com/shu580231/article/details/80176656</guid><author>shu580231</author><pubDate>Thu, 03 May 2018 10:55:23 +0800</pubDate><description><![CDATA[很多情况下，我们在pc端开发的项目，需要在手机上调试。这个时候，但是发现我如果直接将localhost换成自己的ip,是无法访问的，解决办法：在package.json中，，&quot;scripts&quot;: {
  &quot;dev&quot;: &quot;webpack-dev-server --inline --progress --config build/webpack.dev.conf.js&quot;,
  &quot;start&quot;: &quot;np...]]></description><category></category></item><item><title><![CDATA[webstorm stylus 报红]]></title><link>https://blog.youkuaiyun.com/shu580231/article/details/80171176</link><guid>https://blog.youkuaiyun.com/shu580231/article/details/80171176</guid><author>shu580231</author><pubDate>Wed, 02 May 2018 20:20:05 +0800</pubDate><description><![CDATA[今天使用vue-cli构建了一个项目。但是使用stylus写法一直报红，但是在浏览器里设置的样式是生效的。其中，package.json中，这些stylus都是安装过的。&quot;style-loader&quot;: &quot;^0.13.1&quot;,
&quot;stylus&quot;: &quot;^0.54.5&quot;,
&quot;stylus-loader&quot;: &quot;^2.5.0&quot;,并且在style中，也加了。style lang=&quot;stylus]]></description><category></category></item><item><title><![CDATA[多个modal重叠，导致modal滚动条消失事件]]></title><link>https://blog.youkuaiyun.com/shu580231/article/details/79760903</link><guid>https://blog.youkuaiyun.com/shu580231/article/details/79760903</guid><author>shu580231</author><pubDate>Fri, 30 Mar 2018 17:38:29 +0800</pubDate><description><![CDATA[因为最近一直在用modal，modal上再出现modal也是常见的， 但是遇到了一个bug---例如在modal1上弹出一个modal2，关闭modal2之后，会导致modal1滚动条消失，无法滚动。hack：就是在css样式中，增加一个样式：.modal{overflow:auto!important;}原因---弹出新的modal后，会根据当前新的modal内容设置滚动条，关闭这个modal后...]]></description><category></category></item><item><title><![CDATA[table-cell]]></title><link>https://blog.youkuaiyun.com/shu580231/article/details/79354540</link><guid>https://blog.youkuaiyun.com/shu580231/article/details/79354540</guid><author>shu580231</author><pubDate>Fri, 23 Feb 2018 18:41:28 +0800</pubDate><description><![CDATA[table-cell属性是让标签元素以表格单元格的形式呈现，类似于td标签，table-cell会被其他一些css属性破坏，比如float,position:absolute，所以这些属性尽量不同用。设置了table-cell属性的元素对宽度高度比较敏感，对margin值没有反应，相应padding属性。1.table-cell实现等高布局如图所示：三个div里的内容是不相同的，但是容器的高度是根...]]></description><category></category></item><item><title><![CDATA[微信小程序---picker]]></title><link>https://blog.youkuaiyun.com/shu580231/article/details/79291142</link><guid>https://blog.youkuaiyun.com/shu580231/article/details/79291142</guid><author>shu580231</author><pubDate>Thu, 08 Feb 2018 16:43:08 +0800</pubDate><description><![CDATA[微信小程序摒除了select，因为觉得这个在移动端的操作以及显示不友好，从而产生了picker，picker也就是从底部弹起的滚动选择器，现在支持的有5种，通过mode来区分。具体的参照微信小程序开发文档https://mp.weixin.qq.com/debug/wxadoc/dev/component/picker.html。本文章主要解释一个mode为selector，平常比较常用的一些固定...]]></description><category></category></item></channel></rss>