- 博客(8)
- 收藏
- 关注
原创 JavaScript 拼接数组的方法
方法一:使用for循环 let arr = ['a', 'b']; let arr2 = [1, 2]; for(let i in arr2){ arr.push(arr2[i]) } console.log(arr); // ['a', 'b', 1, 2] 方法二:使用concat(),注意concat()方法会生成了一个新的数组,且不改变原来的数组。 let arr = ['a', 'b']; let arr2 = [1, 2]; let newArr = arr.conc
2022-02-09 23:05:04
4653
原创 CSS如何设置超出显示省略号
单行设置 white-space:nowrap; /*内容超宽后禁止换行显示*/ overflow:hidden; /*超出部分隐藏*/ text-overflow:ellipsis; /* 单行,多行文本溢出显示 . . . */ 多行设置 overflow: hidden; /* 超出的文本裁剪 */ text-overflow: ellipsis; /* 超出显示... */ display: -webkit-box; /* 将对象作为弹性盒子 */ -web...
2022-02-09 22:52:02
798
原创 微信公众号开发设置页面字体不跟随系统
在开发公众号时碰到的问题,再此记录一下。 微信公众号中网页的字体会根据微信的设置而改变,这样就会导致页面崩溃。影响用户体验。 解决 ;(function(){ if( typeofWeixinJSBridge=="object"&& typeofWeixinJSBridge.invoke=="function" ){ handleFontSize() }else{ if...
2022-02-09 22:44:30
2074
1
原创 在vue中创建新的字体
第一步 下载的字体,.ttf格式 第二步 在src下新建文件,文件夹中包含以下内容 第三步 编辑font.css @font-face { font-family: 'xjzt'; //命名字体 src: url('xjzt.ttf'); //导入字体ttf文件 font-weight: normal; //设置字体 font-style: normal; //设置字体 } 第四步 配置webpack.base.conf.js 文件 ..
2022-02-09 22:35:38
997
原创 vue 与 iframe之间传参
做的一个项目使用到了svg图,使用iframe 导入,并且需要向iframe传递参数,遇到的小问题,在此记录一下。 vue使用iframe导入svg页面: <!-- vue --> <iframe class="iframe" ref="mainIframe" src="static/plant/beiChang.html" frameborder="0"></iframe> 请求接口并向iframe传递: created(){ //..
2021-10-28 16:49:35
8481
1
原创 import * as 是什么?
1.import 在导入模块中的变量的时候 需要 import { a, b, c, d } from ‘./api.js’ 这样一个一个的导入。 2.如果你想一次性全部导入模块的所有变量就可以使用 * as 代表全部 例子: // methods.js文件 export const abc = () => { console.log(' abc ') } export const ced = () => { console.log(' ced ') } ...
2021-07-22 16:59:49
16925
1
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人