- 博客(23)
- 资源 (1)
- 收藏
- 关注
原创 intersectionobserver API实现懒加载
用法var io = new IntersectionObserver(callback, option)参数:callback参数time:可见性发生变化的时间,是一个高精度时间戳,单位为毫秒target:被观察的目标元素,是一个 DOM 节点对象rootBounds:根元素的矩形区域的信息,getBoundingClientRect()方法的返回值,如果没有根元素(即直接相对于视口滚动),则返回nullboundingClientRect:目标元素的矩形区域的信息intersec.
2021-09-13 13:28:18
242
原创 virtualenv虚拟环境python
pip install virtualenvmkvirtualenv project_env这会在Envs 中创建 project_env虚拟环境选择一个python解释器来搭建:mkvirtualenv env --python=python2.72、在虚拟环境上工作:workon project_env或者,您可以创建一个项目,它会创建虚拟环境,并在 $WORKON_HOME 中创建一个项目目录。 当您使用 workon project_env 时,会 cd -ed 到项目目录中。mk
2021-01-14 10:16:36
130
转载 字体转base64
字体转换网站https://transfonter.org/将下载后的文件解压,找到stylesheet.css文件,将内容复制到代码的CSS文件内引用字体,名字为stylesheet.css对应的名字如: font-family: ‘HYZhuZiMuTouRenW’;
2020-12-24 14:53:14
2335
1
原创 流媒体判断横竖屏
@media screen and (orientation: portrait) {/*竖屏 css*/}@media screen and (orientation: landscape) {/*横屏 css*/body { background: blue;}}
2020-12-14 15:58:02
162
原创 excel 操作
# -*- coding: utf-8 -*-import xlrd, json#读取excelbook = xlrd.open_workbook('name.xlsx')获取第一页内容sheet1 = book.sheets()[0]#表格总行数nrows = sheet1.nrows#表格总列数ncols = sheet1.ncols#读取第i个第4个格子的值sheet1.cell(i, 4).value...
2020-11-30 15:28:37
83
原创 实现点击伪元素才有点击事件
第一种实现方式只能是绑定一个事件,如点击图片实现查看,点击伪元素实现删除则不可以实现。而且会导致:hover等鼠标事件失效,所以不推荐使用第二种实现方式可以绑定一个事件,如点击图片实现在子元素事件中实现查看,点击伪元素在父元素事件中实现删除。.box2-ul li a:before{width: 100px;height: 65px;pointer-events: auto;content: ‘’;position: absolute;top: 189px;left: 24px;curs
2020-09-30 13:53:11
886
原创 滚动条样式
//背景条.dwjdc-context::-webkit-scrollbar {width: .06rem;height: .43rem;background: #3c3a3a;}//滑动条.dwjdc-context::-webkit-scrollbar-thumb {border-radius: 0;background-color: #757879;transition: all .2s;border-radius: .43rem;}
2020-09-25 14:32:59
101
转载 flask分页
1.paginate的用法paginate(page, per_page, error_out=True)page 当前页数per_page 每页显示的条数error_out 是否打印错误信息2.paginate的属性a)paginate.page 当前页数b)paginate.pages 总页数c)paginate.total 数据总条数d)paginate.has_prev 是否存在上一页 返回布尔值e)paginate.has_next 是
2020-09-25 10:38:59
117
原创 pypi更换源
1、pip install webob -i http://mirror.youweb.com/pypi/simple --trusted-host mirror.youweb.com清华大学:https://pypi.tuna.tsinghua.edu.cn/simple阿里云:http://mirrors.aliyun.com/pypi/simple/中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/华中理工大学:http://pypi.hustuni
2020-08-27 10:29:59
434
原创 mysql数据库区分大小写与不区分大小写
1、修改排序规则:ci全称为case insensitive,意思是大小写不敏感,cs区分大小写,bin是以二进制数据存储,且区分大小写。如果要求数据库不区分大小写,则需要选择ci结尾的。
2020-08-18 17:48:35
393
原创 屏幕适应
//屏幕适应(function (win, doc) { if (!win.addEventListener) return; var html = document.documentElement; function setFont() { var html = document.documentElement; var k = 750; html.style.fontSize = html.clientWidth / k * 10
2020-08-13 14:59:42
197
转载 dockerfile
FROM: 指定基础镜像格式: FROM <image> FROM <image>:<tag> FROM <image>@<digest>MAINTAINER: 维护者信息 MAINTAINER <name> MAINTAINER Jasper Xu**RUN:**构建镜像时执行的命令 build时候执行shell执行 RUN <command>exec执行 RUN ["exec
2020-07-06 23:48:16
99
转载 docker常用命令集合
1、查看镜像信息列表docker images2 、查看运行中的所有容器,不加 -a查看运行中的容器docker ps -a3、拉取指定镜像docker pull [images]:[version]4、启动dockerdocker run -p 8000:80 -tdi --privileged [imageID] [command]-i:以交互模式运行容器,通常与 -t 同时使用;-d:后台运行容器,并返回容器ID;-t:为容器重新分配一个伪输入终端,通常与 -i 同时使用
2020-07-06 23:30:09
252
转载 基于python的apline镜像的安装cryptography失败
1.pip install lxml 失败RUN apk add --no-cache gcc musl-dev libxslt-dev2.pip install cffi 失败RUN apk add --no-cache libffi-dev3.pip install cryptography 失败RUN apk add --no-cache libressl-dev我是三个都加进去后成功作者:AaronZgl链接:https://www.jianshu.com/p/23477527
2020-07-06 13:02:43
1085
1
转载 vue子父组件传递方法和值
1.子组件调用父组件两种方法。this.$parent.fatherMethod('hello');<template> <child @fatherMethod="fatherMethodOther"></child></template>this.$emit('fatherMethod', 'hello');2.父组件调用子组件的方法<template> <Button @click="handleClick"&g
2020-07-05 15:16:55
182
原创 python日期相减获取天数,判断是否过期
#获取当前时间 now_time = time.localtime(time.time()) now_time = datetime.datetime(now_time[0], now_time[1], now_time[2]) #格式化数据库日期 compare_time = time.strptime(str(red_date), "%Y-%m-%d") date1 = datetime.datetime(compar..
2020-06-01 19:40:08
1876
原创 flask数据迁移改变字段属性,显示没有改变解决办法
flask数据迁移改变字段属性,显示没有改变解决办法。将migrations文件的env.py中: with connectable.connect() as connection: context.configure( connection=connection, target_metadata=target_metadata, ...
2020-05-03 17:42:51
440
原创 flask
1、flask按照年月和人员id查找指定数据sv_info = Sales_volume.query.filter(and_(extract(‘year’, Sales_volume.sv_date) == 2012,extract(‘month’, Sales_volume.sv_date) == 3),Sales_volume.em_id==em_id).all()...
2020-04-17 16:52:43
96
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人