Basic types of data in ts

ts data type ts data basic data type After declaring the type, the type of the variable cannot be changed A vertical bar |: indicates or is used to connect multiple types (Union types) question mark? Representative optional &Represent and boolean type let bool:boolean=true Number type number let num:number=10 String type string ...

Posted by Valdoua on Sat, 12 Feb 2022 15:20:28 +0100

Generics in TS

The most difficult thing in typescript is undoubtedly generics, so what is the motivation for generics Think about a question: How did generics appear and what problems did it solve Now there is an echo method, which passes in what type of value and returns what type of value function echo(arg) { return arg } const result = echo(123) The re ...

Posted by Adam on Fri, 11 Feb 2022 16:57:08 +0100

Vue3+Typescript(coderwhy) super detailed learning notes vue3 development basic syntax

(pay attention to whether I can accept the update push) I Knowledge supplement 1.1. (understand) this in methods 1.1.1. out of commission Arrow function If we want to use data to return the data in the object in methods, this must have a value, and the data in the data return object should be available through this. ...

Posted by samscripts on Fri, 11 Feb 2022 06:06:30 +0100

Elegant cross window communication and global page management solution cross window message js library for sending messages from different windows

🚀 Elegant cross window communication and global page management solution cross-window-message Share a cross window communication and global page management developed by myself 0. Characteristics Support directional communication and broadcast communication between different pagesIt supports pages opened in any way, not limited to window ...

Posted by optikalefx on Wed, 09 Feb 2022 23:30:10 +0100

Vue3.0 family bucket most complete Getting Started Guide - vue-router@4.x and vuex@4.x (3/4)

3, vue-router@4.x and vuex@4.x vue-router@4.x and vuex@4.x vue2.x uses vue-router@3.x and vuex@3.x ,vue3.x uses vue-router@4.x and vuex@4.x , avoid following vue3 The version numbers of X are mixed. In fact, vue3 Both router and vuex used by X are 4 x. Vue2.0 is used here for convenience of understanding x router,vue3.x router instead of vue ...

Posted by plex303 on Wed, 09 Feb 2022 04:22:02 +0100

TypeScript learning - 20 Mixins

Mixins introduce In addition to the traditional object-oriented inheritance, there is also a popular way to create classes through reusable components, which is to combine the code of another simple class. You may be familiar with mixins and its features in languages such as Scala, but it is also very popular in JavaScript. Blend in Exam ...

Posted by Kingw on Mon, 07 Feb 2022 06:52:09 +0100

TypeScript Learning-10 Advanced Types

Advanced Types Intersection Types Cross-type combines multiple types into one type. This allows us to overlay existing types into one type, which contains all the required characteristics. For example, Person & Serializable & Loggable are both Person and Serializable and Loggable. This means that objects of this type have all thre ...

Posted by imderek on Fri, 04 Feb 2022 18:40:12 +0100

Take you hand in hand to build a simple webpack scaffold

Plugin plug in In the whole process of webpack, loader enables webpack to process more file resources. The plugin exists in the whole packaging process of webpack. The processed content can be processed when the hook exposed by the webpack is triggered. So we can use plugin to process the files in process. index.html file processing Before, ...

Posted by andremta on Thu, 03 Feb 2022 02:15:05 +0100

TypeScript advanced usage

typescript advanced usage introduction As a powerful static type checking tool, TypeScript can be seen in many large and medium-sized applications and popular JS libraries. As a weakly typed language, JS will modify the type of variables without paying attention in the process of writing code, resulting in some unexpected runtime errors. Howev ...

Posted by kimberlc on Sun, 30 Jan 2022 09:17:20 +0100

Egret (wechat) resource CRC management

1, CRC - Cyclic Redundancy Check Because of my lack of talent and learning, I won't explain the principle here. Please Baidu for the detailed principle~ 2, Generate CRC suffix in Egret egret is in config The corresponding interface is provided in the TS file. You can see the judgment of else if (command = = 'publish') in the following co ...

Posted by Floodboy on Fri, 28 Jan 2022 23:15:30 +0100