- 博客(9)
- 资源 (1)
- 收藏
- 关注
原创 JS Math 对象
常用属性:console.log(Math.PI); // 3.141592653589793常用方法: // ceil(x) 对数进行上舍入。 console.log(Math.ceil(11.9)); //12 // floor(x) 对 x 进行下舍入。 console.log(Math.floor(11.9)); //11 // max(x,y,z,...,n) 返回 x,y,z,...,n 中的最高值。 console.log(Math.max(1, 2, 3)); //3
2022-03-31 17:42:05
126
原创 Vue模板中使用数据绑定less变量
实现流程:在less文件中使用:export{}导出变量,在vue文件中使用import导入变量assets/style/common.less文件代码:// 定义变量@main-color: #f00;// 导出变量:export { mainColor: @main-color;}vue文件代码:<template> <div :style="{color: styleColor}"></div></template><
2021-07-16 16:37:47
2868
原创 在React中使用less
使用create-react-app脚手架搭建的react项目时,会自带css和sass。如果要在项目中需要使用less,需要进行一些配置。一、先安装less 和 less less-loadernpm install less less-loader --save-dev二、暴露项目配置文件运行命令:npm run ejec释放配置文件,项目根目录下会生成config文件夹,找到webpack.config.js文件相关说明请参考:暴露配置文件三、配置less,共分为两步1、找到以
2021-05-21 15:37:05
518
1
原创 小程序自定义tabbar,并实现点击事件拦截
需求:有首页和我的两个tabbar页面,点击我的时判断是否登录,如果未登录跳转到登录页,如果已登录进入到我的页面第一部分:配置app.json:{ "pages": [ "pages/index/index", "pages/center/center", "pages/login/login" ], "window": { "backgroundTextStyle": "light", "navig
2020-07-04 17:26:01
3377
原创 vue项目中 使用 amfe-flexible(或lib-flexible) && postcss-pxtorem 自动将px转rem
vue项目中 使用 amfe-flexible(或lib-flexible) && postcss-pxtorem 自动将px转rem1 amfe-flexible安装:npm i -S amfe-flexible用于自动设置根节点字体大小安装lib-flexible:npm install lib-flexible -Slib-flexible已停止维护,可使用amfe...
2019-11-27 16:51:14
5652
原创 简单介绍Javascript中的字符串方法substr()和substring()的区别和用法
在只有一个参数时,两个方法的功能一样,截取并返回参数开始之后的字符var str = 'abcdefg0123456789';var a = str.substr(3);console.log(a);//得到结果: defg0123456789var b = str.substring(3);console.log(b);//得到结果: defg0123456789 在有...
2018-08-07 15:37:08
230
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人