You've got a few, five bad js-coded habits

For more articles, please pay attention to WeChat Public Number: Front End css and js Dry Have you ever felt this way when reading js code? You hardly understand what the code means? Does the code use a lot of outdated JavaScript techniques? Naming and coding style more casual? These are signs of bad coding habits. This article lists fi ...

Posted by JustinMs66@hotmail.com on Mon, 06 Dec 2021 09:41:05 -0800

Ten minutes to understand generics in TypeScript

Please indicate the source of Reprint: the official website of grape City, which provides professional development tools, solutions and services for developers to empower developers. Original source: https://blog.bitsrc.io/understanding-generics-in-typescript-1c041dc37569 What will you learn in this article This article introduces the con ...

Posted by sstoveld on Sun, 05 Dec 2021 21:44:38 -0800

Component communication between parents and grandchildren of vue and component communication between brothers

Component communication between parent and child components Interview question: what are the communication modes between vue components? The first: props+this.$emit: props: Parent component A binds data through v-bind and transfers data to child components, which are received by props Parent component A: <template> <div class ...

Posted by Bullit on Sun, 05 Dec 2021 19:41:21 -0800

Optimize ES5 grammar using ES6 grammar, welcome to add

ES6 is recommended for program optimization and aesthetics. (All javaScript syntax after ES5 is collectively referred to as ES6) 1. About Value Selection Values are common in programs, such as obj from an object. const obj = { a:1, b:2, c:3, d:4, e:5, } Make complaints: const a = obj.a; const b = obj.b; const c = obj. ...

Posted by geoldr on Sun, 05 Dec 2021 19:25:26 -0800

Advanced React components

Advanced react component Introduction to component communication A component is an independent and closed unit. By default, only the component's own data can be used. In the process of componentization, we split a complete function into multiple components to better complete the functions of the whole application. In this process, it is i ...

Posted by ursvmg on Sun, 05 Dec 2021 04:52:05 -0800

Non single file component of Vue component

Non single file component: a file contains n components   1, Components   Definition of component -- a collection of local function codes and resources in an application Components: Understanding: code set used to achieve local (specific) functional effects (html/css/js...)Why: the functions of an interface are complexFunction: ...

Posted by mazazino on Sun, 05 Dec 2021 04:37:04 -0800

119. Slot, mixin, global event bus

1. Slot 1. Default slot Components that encapsulate slots <ul> <li>{{ title }}</li> <slot></slot> </ul> Implementer of slot <Com title="game"> <ul> <li>Zhang San</li> <li>Li Si</li> <li>Wang Wu</li> ...

Posted by nocniagenti on Sun, 05 Dec 2021 04:27:03 -0800

13_JavaScript data structure and algorithm binary search tree

JavaScript data structure and algorithm (XIII) binary search tree Binary search tree Binary Search Tree (BST), also known as binary sort tree and Binary Search Tree. Binary search tree is a binary tree and can be empty. If it is not empty, the following properties are met: Condition 1: all key values of non empty left subtree are less than ...

Posted by bam2550 on Sun, 05 Dec 2021 00:54:35 -0800

Case: Web carousel map

z case: Web carousel map Also known as focus map Functional requirements: When the mouse passes through the rotation chart module, the left and right buttons are displayed and the left and right buttons are hidden Click the button on the right once, and the picture will be played to the left once, and so on. The same is true for the left butto ...

Posted by Yeti on Sat, 04 Dec 2021 21:31:17 -0800

5 - parameter default value, implied global variable, precompiled

(1) . function parameter default value Initialization parameter. If it is not set, the default value of the parameter is undefined function test(a, b){ console.log(a); console.log(b); } test(1); // 1 // undefined Do not pass arguments, set default values for row parameters Only es6 supports formal parameter assignment function test(a ...

Posted by airwinx on Sat, 04 Dec 2021 20:12:29 -0800