Conditional compilation: the process of using the same set of code and the same compilation and build process to selectively compile the specified code according to the set conditions, so as to output different programs
E-chat SDK needs a set of client core code developed by TypeScript to realize cross platform support (such as w ...
Posted on Sun, 14 Jun 2020 01:28:10 -0400 by JJBlaha
Build front end Lint workflow from zero
Eslint + prettier + husky + lint staged + typescript + eslint config alloy to ensure the quality of project code
Inherit the concept of plug-in and configuration advocated by ESLint, and meet the personalized needs (i.e. let professional tools do what they are good at)
The novice sug ...
Posted on Tue, 09 Jun 2020 04:36:14 -0400 by TitanKing
Posted on Fri, 29 May 2020 06:04:06 -0400 by Toonster
As we all know, in vue, if you want to define a global variable method is very simple, you can directly mount attributes or methods on the prototype of vue.
However, with typescript added Vue.prototype $XXX = XXX is not a good way to mount. No matter where you are, you can't access the content. It's not on the Vue prototype either. Then what s ...
Posted on Fri, 22 May 2020 06:11:48 -0400 by Chezshire
1, Type alias
TypeScript provides a convenient syntax for setting aliases for type annotations. You can use type SomeName = someValidTypeAnnotation to create aliases, such as:
type Pet = 'cat' | 'dog';
let pet: Pet;
pet = 'cat'; // Ok
pet = 'dog'; // Ok
pet = 'zebra'; // Compiler error
2, Basic knowledge
In order to better underst ...
Posted on Sat, 16 May 2020 00:32:42 -0400 by sickness01
Jest and enzyme front end unit testing tools
What is Jest?
It is suitable for projects using Babel, TypeScript, Node, React, Angular, Vue, etc!
Use yarn to install jet:
yarn add --dev jest
Posted on Tue, 28 Apr 2020 21:41:17 -0400 by Wave
1. Editing Excel Online
At this stage, the background management system needs to realize the function of online excel editing in many times. The main advantages are as follows:
1. Browse and edit excel files online (cross-platform, zero-dependence, always inconvenient to install Microsoft office)
(2) File management, rights control (data sec ...
Posted on Tue, 28 Apr 2020 12:48:42 -0400 by noaksey2000
Single Responsibility Principle (SRP): Components (functions, classes, modules) must focus on a single task
Open/Close Principle (OCP): Consider scalability when designing, but modify the original code at least when extending
Richter Replacement Principle (LSP): Any class in a pr ...
Posted on Sun, 16 Feb 2020 21:37:32 -0500 by Lumio
1. Implement the Vue component of TypeScript.
Take Types component as an example to rewrite
<li :class="type === '-' && 'selected'"
<li :class="type === '+' && 'selected'"
Posted on Fri, 07 Feb 2020 07:02:29 -0500 by angelkay73
Original address: Using typescript to transform koa development framework
Next, we start to transform the node back-end scaffold based on the koa framework:
The construction of ...
Posted on Tue, 04 Feb 2020 03:00:08 -0500 by anakadote