- 博客(55)
- 收藏
- 关注
原创 [vite]vue2+vite引入svg
背景介绍 由于webpack打包太慢,使用vite进行打包,由于更改为vite,原始svg引入产生问题, const svgFiles = require.context('./svg', true, /\.svg$/) console.log("svg",svgFiles) const iconList = svgFiles.keys().map(item => svgFiles(item)) 因此根据底下大佬文章进行了更改, https://juejin.cn/post/69323512932
2022-04-25 11:41:49
2538
原创 自记录开发问题
1.request.js 文件中接口进行拦截,如果不成功则返回 Promise.reject(new Error(${res.code}-${res.msg || res.message} || 'Error')) 无法根据返回的状态进行更改,此时使用promise.then(()=>{}).finally()进行问题解决。 2. ...
2021-08-26 18:22:51
1542
原创 vue页面跳转的方式(自己记录)
1.router-link跳转 //不带参数 <router-link to = '/index'> <button>go</button> </router-link> //带参数 <router-link to = "{path: 'index',query:{id:123456}"> <button>go</button> </router-link> <router-link to = "{pa
2021-08-03 16:55:32
915
原创 elementUI upload组件当auto-upload=“false“设置为flase时候before-upload无法生效
关于elementUI upload组件当auto-upload="false"设置为flase时候before-upload无法生效 个人解决方法:通过:on-change进行监听(伪代码) handleChange(file, fileList){ let isFileType = validate(fileType) if (isFileType) { this.$message.warning('仅支持xls/xlsx格式!') fileList.pop() }
2021-07-23 16:27:44
3547
原创 前端问题总结收集
http缓存机制 cookie sessionStorage lcoaleStorage,cookie 是不是每一个都能读 TCP 三路握手 四路挥手 axois:axois.get().then().catch() promise all/race场景题 手撕串行 promise 请求 手撕图片加载调度器,给一个 urls 的数组和每次最多加载的数量,加载完加载剩下的序列:使用发布者 监听者机制/promise.race()=>使用 hashmap=>hashmap 中设置 key 的值的方.
2020-12-08 20:31:14
140
原创 js继承方式(自存)
js继承的六种继承方式 function Person(){ this.name = 'person' } 1.原型链继承 function Child1(){ this.name = 'child1' } Child1.prototype = new Person() 原型链继承让新实例的原型等于父类的实例 优势:实例可以继承实例的构造函数的属性,父类的构造函数属性,父类原型的属性(实例不会继承父类实例的属性) 劣势:新实例无法向父类构造函数传参、继承单一、所有新实例都会共享父类实例的属性。原型
2020-12-08 20:30:28
128
原创 168. Excel Sheet Column Title
Given a positive integer, return its corresponding column title as appear in an Excel sheet. For example: 1 -> A 2 -> B 3 -> C ... 26 -> Z 27 -> AA 28 -> AB ... Example 1: Input: 1...
2019-11-14 10:32:03
179
原创 167. Two Sum II - Input array is sorted
Two Sum II - Input array is sorted Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number. The function twoSum shoul...
2019-11-13 11:31:34
154
原创 141. Linked List Cycle
Linked List Cycle Given a linked list, determine if it has a cycle in it. To represent a cycle in the given linked list, we use an integer pos which represents the position (0-indexed) in the linked...
2019-11-12 10:14:23
140
原创 112. Path Sum
Path Sum Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum. Note: A leaf is a node with no children....
2019-11-11 15:47:56
165
原创 121. Best Time to Buy and Sell Stock
Best Time to Buy and Sell Stock Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction (i.e., buy one ...
2019-11-08 15:42:33
164
原创 110. Balanced Binary Tree
Balanced Binary Tree Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as: a binary tree in which the left and right subtrees of eve...
2019-11-07 16:00:36
167
原创 125. Valid Palindrome
Valid Palindrome Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. Note: For the purpose of this problem, we define empty string as valid ...
2019-11-06 10:46:31
152
原创 136. Single Number
Single Number Given a non-empty array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could you implement...
2019-11-05 10:52:03
147
原创 107. Binary Tree Level Order Traversal II
Binary Tree Level Order Traversal II Given a binary tree, return the bottom-up level order traversal of its nodes’ values. (ie, from left to right, level by level from leaf to root). For example: Gi...
2019-11-04 11:10:23
147
原创 102. Binary Tree Level Order Traversal
Binary Tree Level Order Traversal Given a binary tree, return the level order traversal of its nodes’ values. (ie, from left to right, level by level). For example: Given binary tree [3,9,20,null,nu...
2019-11-03 15:19:50
170
原创 104. Maximum Depth of Binary Tree
Maximum Depth of Binary Tree Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node. Note: A l...
2019-11-02 20:19:06
191
原创 101. Symmetric Tree
Symmetric Tree Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree [1,2,2,3,4,4,3] is symmetric: 1 / 2 2 / \ / 3 4 4 3...
2019-11-01 17:02:17
151
原创 61. Rotate List
Rotate List Given a linked list, rotate the list to the right by k places, where k is non-negative. Example 1: Input: 1->2->3->4->5->NULL, k = 2 Output: 4->5->1->2->3->...
2019-10-31 14:51:44
157
原创 91. Decode Ways
Decode Ways A message containing letters from A-Z is being encoded to numbers using the following mapping: ‘A’ -> 1 ‘B’ -> 2 … ‘Z’ -> 26 Given a non-empty string containing only digits, det...
2019-10-30 19:43:35
154
原创 90. Subsets II
Subsets II Given a collection of integers that might contain duplicates, nums, return all possible subsets (the power set). Note: The solution set must not contain duplicate subsets. Example: Input:...
2019-10-29 10:52:54
119
原创 78. Subsets
Subsets Given a set of distinct integers, nums, return all possible subsets (the power set). Note: The solution set must not contain duplicate subsets. Example: Input: nums = [1,2,3] Output: [ [3], ...
2019-10-28 16:03:05
123
原创 83. Remove Duplicates from Sorted List
Remove Duplicates from Sorted List Given a sorted linked list, delete all duplicates such that each element appear only once. Example 1: Input: 1->1->2 Output: 1->2 Example 2: Input: 1->...
2019-10-26 20:53:13
112
原创 77. Combinations
Combinations Given two integers n and k, return all possible combinations of k numbers out of 1 … n. Example: Input: n = 4, k = 2 Output: [ [2,4], [3,4], [2,3], [1,2], [1,3], [1,4], ] python: class ...
2019-10-09 17:05:56
114
原创 60. Permutation Sequence
The set [1,2,3,…,n] contains a total of n! unique permutations. By listing and labeling all of the permutations in order, we get the following sequence for n = 3: “123” “132” “213” “231” “312” “321” G...
2019-10-08 11:19:30
130
原创 55.jumpGame 2
Jump Game Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maximum jump length at that position. Deter...
2019-10-07 14:27:02
136
原创 56. Merge Intervals
Given a collection of intervals, merge all overlapping intervals. Example 1: Input: [[1,3],[2,6],[8,10],[15,18]] Output: [[1,6],[8,10],[15,18]] Explanation: Since intervals [1,3] and [2,6] overlaps, m...
2019-09-18 20:51:50
171
原创 53. Maximum Subarray
Maximum Subarray Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. Example: Input: [-2,1,-3,4,-1,2,1,-5,4], Out...
2019-09-03 16:00:17
118
原创 49. Group Anagrams
Group Anagrams Given an array of strings, group anagrams together. Example: Input: [“eat”, “tea”, “tan”, “ate”, “nat”, “bat”], Output: [ [“ate”,“eat”,“tea”], [“nat”,“tan”], [“bat”] ] Note: All input...
2019-09-03 11:05:30
233
原创 46. Permutations
Permutations Given a collection of distinct integers, return all possible permutations. Example: Input: [1,2,3] Output: [ [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], [3,2,1] ] python class Solution...
2019-08-26 20:29:50
110
原创 43. Multiply Strings
Multiply Strings Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2, also represented as a string. Example 1: Input: num1 = “2”, num2 = “3” Out...
2019-08-25 19:43:48
142
原创 34. Find First and Last Position of Element in Sorted Array
Find First and Last Position of Element in Sorted Array Given an array of integers nums sorted in ascending order, find the starting and ending position of a given target value. Your algorithm’s run...
2019-08-23 10:54:36
177
原创 28. Implement strStr()
Implement strStr() Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Example 1: Input: haystack = “hello”, needle = “ll” Output: 2 Example 2: I...
2019-08-20 10:53:03
102
原创 27. Remove Element
Remove Element Given an array nums and a value val, remove all instances of that value in-place and return the new length. Do not allocate extra space for another array, you must do this by modifyin...
2019-08-20 10:26:37
115
原创 26. Remove Duplicates from Sorted Array
Remove Duplicates from Sorted Array Given a sorted array nums, remove the duplicates in-place such that each element appear only once and return the new length. Do not allocate extra space for anoth...
2019-08-20 10:20:19
111
原创 24. Swap Nodes in Pairs
Swap Nodes in Pairs Given a linked list, swap every two adjacent nodes and return its head. You may not modify the values in the list’s nodes, only nodes itself may be changed. Example: Given 1->...
2019-08-19 10:34:37
120
原创 22. Generate Parentheses
Generate Parentheses Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set is: [ “((()))”, “(()())”, “(())(...
2019-08-18 20:35:43
107
原创 matlab相关tips
size() sz = size(A) szdim = size(A,dim) [m,n] = size(A) [sz1,…,szN] = size(A) sz = size(A) 返回一个行向量,其元素包含 A 的相应维度的长度。例如,如果 A 是一个 3×4 矩阵,则 size(A) 返回向量 [3 4]。sz 的长度为 ndims(A)。 如果 A 是表或时间表,则 size(A) 返回由...
2019-08-16 21:25:13
431
原创 21. Merge Two Sorted Lists
Merge Two Sorted Lists Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. Example: Input: 1->2->4, 1-...
2019-08-16 12:48:18
132
原创 20. Valid Parentheses
Valid Parentheses Given a string containing just the characters ‘(’, ‘)’, ‘{’, ‘}’, ‘[’ and ‘]’, determine if the input string is valid. An input string is valid if: Open brackets must be closed by ...
2019-08-16 11:18:14
112
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅