Summarize some basic front-end knowledge. Some knowledge may be asked during the front-end interview, so making a record will also help others check. If there are any questions, you can point them out and actively correct them.
Variable types and calculations
What are the types of typeof in JS
console.log(typeof undefined); //undefi ...
catalogue
1. v-if
1.1 template
1.2 v-else
1.3 v-else-if
1.4 manage reusable elements with key
2.v-show
3.v-if vs v-show
4. Use V-IF with v-show
1. v-if
The v-if instruction is used to render a piece of content conditionally. This content will only be rendered when the expression of the instruction returns the truth value.
< ...
Posted by PerfecTiion on Fri, 20 May 2022 01:08:21 +0300
When writing a custom plug-in, you need to know that the webpack plug-in consists of the following:
A JavaScript named function or JavaScript class.Define an apply method on the prototype of the plug-in function.Specify an event hook bound to the webpack itself.Process specific data for webpack internal instances.Call the callback provided by ...
Posted by Smasher on Fri, 20 May 2022 00:03:21 +0300
1. this
Except for the less commonly used with and eval, the pointers of this are roughly divided into the following four types:
Use as a method of an object
Called as a normal function
Constructor use
Function.prototype.call and Function.prototype.apply calls
1.1 Method calls as objects
When a function is called as a method of an object, thi ...
Posted by Rob the R on Thu, 19 May 2022 17:36:13 +0300
Share a practical JavaScript code fragment to help you quickly complete your development tasks
maxItemOfArray
1. This function can return the maximum value of an array.
const maxItemOfArray = (arr)=>[...arr].sort((a,b)=>b-a).slice(0,1)[0]
let maxItem = maxItemOfArray([0,23,23,23,4,5,2])
areAllEqua
2. This code can check whether all ite ...
Posted by chuckjones on Thu, 19 May 2022 15:54:10 +0300
preface:When we write js code, we often encounter complex logic judgment. Usually, you can use if/else or switch to realize multiple conditional judgment, but there will be a problem. With the increase of logic complexity, the if/else/switch in the code will become more and more bloated, and the readability will become worse and worse, so we ca ...
Posted by seanrock on Thu, 19 May 2022 09:17:19 +0300
Overview
In the front-end field, with the popularity of Vue, React, Angular and other frameworks, front-end engineering and modularization have become the mainstream technical solutions. The SPA single-page application built by this type of framework has the advantages of good user experience, good rendering performance, and high maintainabilit ...
Posted by PhantomCode on Thu, 19 May 2022 03:51:44 +0300
DOM manipulation of CSS
Read and modify inline styles
1. Use the style attribute to manipulate the inline style of an element
- Read inline styles:
Syntax: element.style.style name
- example:
element.style.width
element.style.height
- Note: if the style name has-,you need to change the style name to camel case
Will-remove, ...
Posted by Duje_KH on Thu, 19 May 2022 03:17:02 +0300
Deconstruction in JS
**Statement: * * article taken from Crazy technology house Front end stack Sunny trees This article is a learning record based on the contents of predecessors.
Deconstruction and use of variables
The deconstruction of variables is mainly used to read, access and operate some attributes or values. Here are five common var ...
Posted by mark_18 on Wed, 18 May 2022 23:15:41 +0300
Thoroughly understand closures through examples
In JS, closure and asynchrony are called two major difficulties. What is a closure and what is the function of a closure?
Before we talk about closures, let's take a look at variable scope. There are two types of variables according to their scope: global variables and local variables. There are m ...
Posted by qartis on Wed, 18 May 2022 17:19:58 +0300