摘要: 三种方法: 1.document.getElementById("id").style.height,这种方法的前提是必须之前已经显示的在css中声明过height,才能取得正确的值 2.document.getElementById("id").clientHeight 3.document.ge 阅读全文
posted @ 2019-12-04 10:11 小蓉儿 阅读(8011) 评论(0) 推荐(1) 编辑
摘要: 遇到的问题: 在vue项目开发过程中,我们常常会在页面中添加背景图片。可是当我们在样式中添加了背景图片,编译打包部署到服务器上时,发现图片并不能显示出来,这是为什么呢~~~ 我们一般写的css样式如下: 问题原因: 因为在编译打包后,图片的路径解析出现了问题。 解决方法: 1、在data中定义如下: 阅读全文
posted @ 2019-12-02 13:30 小蓉儿 阅读(1979) 评论(0) 推荐(0) 编辑
摘要: ``` div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } ``` 阅读全文
posted @ 2019-11-28 15:32 小蓉儿 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 前端实现单行垂直居中用的最多的方法可能就是line height了吧。该属性在pc端和ios手机上效果都很好,可到了安卓手机,有很大几率发生文字上移的现象 知乎有人分析了导致这一现象的原因,Android浏览器下line height垂直居中为什么会偏离?大家可以试试文章中的解决方案,反正我试了并没 阅读全文
posted @ 2019-11-28 14:16 小蓉儿 阅读(413) 评论(0) 推荐(0) 编辑
摘要: 苹方 简 常规体 苹方 简 极细体 苹方 简 细体 苹方 简 纤细体 苹方 简 中黑体 苹方 简 中粗体 苹方 繁 苹方 港 阅读全文
posted @ 2019-11-28 14:10 小蓉儿 阅读(1744) 评论(0) 推荐(0) 编辑
摘要: for of entries() 可以同时拿到数组的索引跟值 因此可以使用解构的语法: for of 示例 1. 求和 2.字符串 阅读全文
posted @ 2019-11-25 14:16 小蓉儿 阅读(359) 评论(0) 推荐(0) 编辑
摘要: const fruits = ['Apple','Banana','Orange','Mango']; es5: 可读性差 for(let i=0; i < fruits.length; i ++){ console.log(fruits[i]); }// Apple// Banana// Oran 阅读全文
posted @ 2019-11-25 13:36 小蓉儿 阅读(88) 评论(0) 推荐(0) 编辑
摘要: const numbers = ['one', 'two', 'three', 'four'] es5: const one = numbers[0]; //one const two = numbers[1]; //two es6: 获取到相应位置的数组原素的值 const [one, two] 阅读全文
posted @ 2019-11-25 10:55 小蓉儿 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 当我们要得到Tom对象的属性的时候, es5写法: const name = Tom.name const age = Tom.ageconst ..... console.log(name,age); // Tom Jones 25 es6写法: const { name, age} = Tom; 阅读全文
posted @ 2019-11-25 10:35 小蓉儿 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 1、在阿里矢量图标库将想要的图标加入购物车,然后在购物车中将图标添加到项目; 2、到我的项目中,将图标下载到本地 3.在vue项目的assets文件夹下新建一个iconfont文件夹(名字自定义),将刚刚下载下来的代码包中的 iconfont.css、 iconfont.eto、 iconfont. 阅读全文
posted @ 2019-11-11 11:17 小蓉儿 阅读(761) 评论(0) 推荐(0) 编辑