
demo
一些示例
有生之年~
hello, world!
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
nginx server.conf demo
nginx server 配置demo原创 2022-11-23 02:52:43 · 722 阅读 · 0 评论 -
JSEncrypt: 非对称加密 RSA
1、修改源码,搜索:"t.prototype.getPublicKey = function(", 在后面接着加3个函数(t.prototype.encryptLong = function(data) { const text = this.encode2Unicode(data); const akey = this.key; const maxLength = ((akey.n.bitLength() + 7) >> 3) - 11; try { const转载 2022-01-25 09:48:13 · 459 阅读 · 0 评论 -
load more ,滚动加载
dataAll = []data = []loadDataOpt = { pageNo: 0, hasMore: false, pageSize: 15, isLoading: false};getScreenBottomLastItemData(): number { const $list = document.querySelectorAll('.item'); const $last = $list[$list.length - 1]; const toBo.原创 2022-01-25 09:28:07 · 1050 阅读 · 0 评论 -
crypto-js : 加密与解密
function encrypt(param) { // method: 'AES', 'DES' // mode: 'CBC', 'ECB' const {key, text, method, mode} = param; const keyHex = CryptoJS.enc.Utf8.parse(key); if (!CryptoJS[method]) { throw new Error(`...原创 2022-01-13 15:19:47 · 685 阅读 · 0 评论 -
[解决方案-css] : 不管有几个child,都均分parent的宽度;如果只有一个,就100%
<div class="parent"> <span> 1 </span> <span> 2 </span></div><div class="parent"> <span> 1 </span></div>.parent { display: flex;}.parent > * { flex-grow: 1;}...原创 2021-12-07 14:38:13 · 477 阅读 · 0 评论 -
getBoundingClientRect 与 滚动加载
getBoundingClientRect用bottom举例, 获取到的数据是元素底部相对于屏幕上边的距离const client = $dom.getBoundingClientRect();1、如果元素位于屏幕上面的不可见区域,client.bottom 会是负数2、如果元素位于屏幕下面不可见区域,client.bottom > window.innerHeight假如有个滚动加载的需求:1、元素需要滚动加载,那么首先已经加载的部分最后一条记录的client....原创 2021-12-02 11:14:43 · 690 阅读 · 0 评论 -
angular: 动态切换主题方案之一
1、angular.json "styles": [ "src/styles.scss", { "input": "src/styles/theme.dark.scss", "bundleName": "dark", "inject": false }, { .原创 2021-12-01 21:27:45 · 1176 阅读 · 0 评论 -
ng-zorro 的 th[nzWidth]逻辑链
th.directive.ts:tr.directive.tstable.component.ts原创 2021-11-28 19:22:16 · 182 阅读 · 0 评论 -
charts examples
// 背景是横线,有渐变的柱状图function demo_01() { const chartBarIns = echarts.init(document.getElementById('demo-01')); const chartBarData = [ { name: '1-3次', value: 10}, { name: '4-7次', value: 18}, { name: '7-11次', value: 13}, ];...原创 2021-07-14 22:43:52 · 260 阅读 · 0 评论 -
逐渐插入效果
逻辑:1、list里面放入一个元素,但是这个元素是 【偏移了】一段距离2、加上class,修正【偏移】3、假设list里面已经有五个元素,那么原来这五个元素全都都有class修正偏移,只有新unshift进去的那个元素,settimeout修正偏移,产生动画。css:.item { transition: all 0.3s; overflow: hidden; opacity: 0; margin-top: -30px;原创 2021-07-14 22:16:52 · 95 阅读 · 0 评论