- 博客(115)
- 资源 (4)
- 收藏
- 关注
原创 element cascader lazy lazyload 动态加载的时候如何赋初始值
this.$refs['cascaderRefArea'].inputValue = '你初始要展示的值'好使!
2022-06-17 20:09:17 879 3
原创 1952. Three Divisors 三除数
Given an integern, returntrueifnhasexactly three positive divisors. Otherwise, returnfalse.An integermis adivisorofnif there exists an integerksuch thatn = k * m.Example 1:Input: n = 2Output: falseExplantion: 2 has only two divis...
2022-04-24 17:25:09 377
原创 2016. Maximum Difference Between Increasing Elements增量元素之间的最大差值
Given a0-indexedinteger arraynumsof sizen, find themaximum differencebetweennums[i]andnums[j](i.e.,nums[j] - nums[i]), such that0 <= i < j < nandnums[i] < nums[j].Returnthemaximum difference.If no suchiandjexists, return...
2022-04-24 16:46:47 360
原创 【LeetCode】406. Queue Reconstruction by Height
Suppose you have a random list of people standing in a queue. Each person is described by a pair of integers(h, k), wherehis the height of the person andkis the number of people in front of t
2022-04-24 16:44:08 190
原创 718. Maximum Length of Repeated Subarray【最大公共子数组】
其实这个数组换成字符串来看也是一样的Given two integer arraysnums1andnums2, returnthe maximum length of a subarray that appears inbotharrays.Example 1:Input: nums1 = [1,2,3,2,1], nums2 = [3,2,1,4,7]Output: 3Explanation: The repeated subarray with maximum len...
2022-04-24 16:26:53 264
原创 最长公共子序列1143. Longest Common Subsequence
昨天笔试题里看到了,其实有一点点区别,不过这个似乎更难一点。先做了。Given two stringstext1andtext2, returnthe length of their longestcommon subsequence.If there is nocommon subsequence, return0.Asubsequenceof a string is a new string generated from the original string with so...
2022-04-21 17:12:29 157
原创 1446. Consecutive Characters JavaScript解法
Thepowerof the string is the maximum length of a non-empty substring that contains only one unique character.Given a strings, returnthepowerofs.Example 1:Input: s = "leetcode"Output: 2Explanation: The substring "ee" is of length 2 with th...
2022-04-12 17:11:04 815
原创 safe area
<meta name="viewport" content="viewport-fit=cover" />body { padding-top: constant(safe-area-inset-top); //为导航栏+状态栏的高度 88px padding-left: constant(safe-area-inset-left); //如果未竖屏时为0 padding-right: constan.
2021-02-25 10:12:00 374
原创 chrome获取的request没带上cookie并报错同源策略
A cookie associated with a cross-site resource at h was set without the `SameSite` attribute. It has been blocked, as Chrome now only delivers cookies with cross-site requests if they are set with `SameSite=None` and `Secure`. You1.打开chrome://flags/..
2020-08-14 09:22:07 1023
原创 微信小程序-改变switch/radio/checkbox等组件的大小
微信暂时没有提供这些组件大小的调节。可以用样式transform:scale(0.8)来调整
2020-05-15 11:26:22 465
原创 全网站变灰,公祭日活动界面如何实现?
html { -webkit-filter: grayscale(100%); filter: progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);}第一行是基本实现,第二行针对IE的浏览器。补充,ie10 11不兼容老ie的activex方式原文链接...
2020-04-07 11:45:21 736
原创 vue-router原理浅析
本文将浅析vue-router的具体实现,并且实现一个简易的vue-router。一.前置知识如果你很了解vue的插件应该怎么写,可以跳过此部分。1.Vue.use( plugin)安装 Vue.js 插件。Vue.js 的插件应该暴露一个install方法。这个方法的第一个参数是Vue构造器,第二个参数是一个可选的选项对象:MyPlugin.install = f...
2020-03-11 15:08:46 401
原创 特别的/高冷的/金属感的/css3/loading效果
等边三角形,每条边单独进入,转圈圈的纯css实现现在画三角形多半是通过宽高为0的元素,用border来实现的,但是产品说:“想要一条线一条线单独出来,有一种连线的感觉”哦....不知道怎么录gif反正是这个三角形连线出现 然后一直在转圈圈。先写html。<div class="whiteTriWrap"> <div class="rotate...
2019-09-27 17:41:05 326
原创 微信小程序,catchlongtap之后会触发catchtap的问题。
在微信小程序开发中,catchlongtap/bindlongtap如果和catchtap/bindtap一起监听一个元素的话,在用户长按之后,会依次触发longtap和tap绑定事件,当然这并非是我的意图,我希望的是用户短按就只触发短按,长按就只触发长按。搜索解决方案的时候看到了这篇文章https://blog.csdn.net/weixin_34319640/article/detail...
2019-07-05 10:38:45 1937
转载 js通过json导出Excel csv xls
通过将json遍历进行字符串拼接,将字符串输出到csv文件,代码如下<html><head> <p style="font-size: 20px;color: red;">使用a标签方式将json导出csv文件</p> <button onclick='tableToExcel()'>导出</button>&l...
2019-06-11 17:40:39 816 1
转载 好看的滚动条样式
::-webkit-scrollbar { width: 14px; height: 14px;}::-webkit-scrollbar-track,::-webkit-scrollbar-thumb { border-radius: 999px; border: 5px solid transparent;}::-webkit-scrollbar-track ...
2019-04-23 16:36:08 2645
原创 elementUI table中show-summary时,同时使用了summary-method,如何主动更新合计数据
方法一:用了一个trick<el-table :summary-method="getSummaries" :show-summary="showSum" >需要更新时调用 this.showSum=false; this.$nextTick() .then( ()=> { this.showSum=tru...
2019-04-19 16:25:51 23295 11
原创 ionic4引入高德地图
1.首先你要有一个高德地图的key2.在index.html中引入高德地图3.文件中写<ion-content> <div #map_container class="map_container"></div></ion-content>4.xxx.page.tsimport { Component , ViewChild...
2019-02-21 17:49:30 1242 1
原创 css 修改scrollbar样式
滚动条从外观来看是由两部分组成:1,可以滑动的部分,我们叫它滑块2,滚动条的轨道,即滑块的轨道,一般来说滑块的颜色比轨道的颜色深。 滚动条的css样式主要有三部分组成:1、::-webkit-scrollbar 定义了滚动条整体的样式;2、::-webkit-scrollbar-thumb 滑块部分;3、::-webkit-scrollbar-thumb 轨道部分;...
2019-01-10 12:04:28 1798
转载 写好 JS 条件语句的 5 条守则
https://mp.weixin.qq.com/s/JMwPdQSSTLWPSrLda5Yo5g 在用 JavaScript 工作时,我们经常和条件语句打交道,这里有5条让你写出更好/干净的条件语句的建议。以下代码几乎都是ES6的语法,暂时还有兼容性问题,但是可以通过babel解决,可以大胆用了 1.多重判断时使用 Array.includes2.更少的嵌套,尽早 ret...
2019-01-07 17:13:29 158
原创 js引擎7.2
解析器更快了async await更快的实现 默认启用通过webassembly来指导顶级执行层中的代码生成对class的extend更好的支持
2019-01-04 17:35:06 124
原创 垂直居中
之前一直用的absolute定位然后高度写死,再用负值margin。现在主要用flexmain { display: flex; align-items: center; justify-content: center; width: 18em; height: 10em;}今天发现还有absolute定位,left top 50%...
2019-01-04 17:33:04 131
转载 如何在Vue项目中使用vw实现移动端适配
有关于移动端的适配布局一直以来都是众说纷纭,对应的解决方案也是有很多种。在《使用Flexible实现手淘H5页面的终端适配》提出了Flexible的布局方案,随着viewport单位越来越受到众多浏览器的支持,因此在《再聊移动端页面的适配》一文中提出了vw来做移动端的适配问题。到目前为止不管是哪一种方案,都还存在一定的缺陷。言外之意,还没有哪一个方案是完美的。事实上真的不完美?其实不然。最近为...
2018-11-09 11:37:46 251
转载 CSS3 动画卡顿性能优化解决方案
https://segmentfault.com/a/1190000013045035在使用css3 transtion做动画效果时,优先选择transform,尽量不要使用height,width,margin和padding在使用height,width,margin,padding作为transition的值时,会造成浏览器主线程的工作量较重,例如从margin-left:-20px...
2018-08-07 09:21:04 4611
原创 【微信小程序】类微信样式的弹出框/模态框
github地址:https://github.com/sajiang/popup-for-weixin可以查看完整的组件代码和使用方法。效果: 1.引入component/popUp2.is-show-pop-up="{{isShowModal}}"来控制popUp的弹出和关闭3.bind:closepopup="modalClosed"方法modalClo...
2018-06-26 14:30:10 3587
原创 tensorFlow从啥子都不会到跑路【长期更新】
1.环境安装https://blog.csdn.net/qq_16257817/article/details/75001854这个文章写得很好!按照它说的照做!2.稍稍入门现在有环境了,试试写代码https://www.jianshu.com/p/2ea7a0632239这个文章写得很好!但是如果你没有Python基础的话可能会有点云里雾里。不要紧!我来补充。先...
2018-05-30 14:54:13 371
原创 2018年刑侦科推理试题【JavaScript解法】
刚刚朋友发来这张图,说自己做出来了,来考考我。我整个人是懵逼的,逻辑渣是拒绝这种题的。遍历找答案的话,那还差不多。for (var i = 0; i < Math.pow(4,10); i++) { var tempAnswer=i.toString(4).padStart(10, '0') ; if (judge(tempAnswer)) { ...
2018-03-05 09:59:35 1944
原创 【LeetCode】682. Baseball Game
You're now a baseball game point recorder.Given a list of strings, each string can be one of the 4 following types:Integer (one round's score): Directly represents the number of points you g
2017-11-24 14:56:19 256
原创 【LeetCode】728. Self Dividing Numbers
A self-dividing number is a number that is divisible by every digit it contains.For example, 128 is a self-dividing number because 128 % 1 == 0, 128 % 2 == 0, and 128 % 8 == 0.Also, a self-d
2017-11-23 10:12:57 350
原创 【LeetCode】657.Judge Route Circle
Initially, there is a Robot at position (0, 0). Given a sequence of its moves, judge if this robot makes a circle, which means it moves back to the original place.The move sequence is represented
2017-11-22 14:36:16 223
原创 【LeetCode】442. Find All Duplicates in an Array
Given an array of integers, 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once.Find all the elements that appear twice in this array.Could you do it without ex
2017-08-15 15:33:09 235
原创 【LeetCode】513. Find Bottom Left Tree Value
Given a binary tree, find the leftmost value in the last row of the tree.Example 1:Input: 2 / \ 1 3Output:1Example 2: Input: 1 / \ 2 3
2017-08-11 11:44:21 242
原创 【LeetCode】647. Palindromic Substrings
Given a string, your task is to count how many palindromic substrings in this string.The substrings with different start indexes or end indexes are counted as different substrings even they consis
2017-08-11 10:07:48 443
原创 【LeetCode】654. Maximum Binary Tree
Given an integer array with no duplicates. A maximum tree building on this array is defined as follow:The root is the maximum number in the array.The left subtree is the maximum tree constructed f
2017-08-08 14:37:55 333
原创 【LeetCode】496. Next Greater Element I
You are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of nums2. Find all the next greater numbers for nums1's elements in the corresponding places of
2017-08-01 10:42:59 236
原创 【LeetCode】463. Island Perimeter
You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water. Grid cells are connected horizontally/vertically (not diagonally). The grid is completely
2017-08-01 09:53:13 209
原创 【LeetCode】637. Average of Levels in Binary Tree
Given a non-empty binary tree, return the average value of the nodes on each level in the form of an array.Example 1:Input: 3 / \ 9 20 / \ 15 7Output: [3, 14.5, 11]Explan
2017-07-31 16:30:16 406
原创 【LeetCode】575. Distribute Candies
哇,这么题!!虽然写的是easy!但是我!!!用了三种方法才过!Given an integer array with even length, where different numbers in this array represent different kinds of candies. Each number means one candy of the correspo
2017-07-21 14:23:15 416
原创 【LeetCode】566. Reshape the Matrix
In MATLAB, there is a very useful function called 'reshape', which can reshape a matrix into a new one with different size but keep its original data.You're given a matrix represented by a two-dimen
2017-07-21 10:03:20 340
原创 【LeetCode】557. Reverse Words in a String III
Given a string, you need to reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order.Example 1:Input: "Let's take LeetCode contes
2017-07-21 09:07:03 401
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人