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
Posted on Mon, 27 Jan 2020 21:44:16 -0500 by JesuZ
The implementation of Vue data response system based on ES6 agent model
1. Tool preparation
The required environment is as follows:
Node environment (babel)
Knowledge reserve needed:
Introduction to ES6 standard
2. way of thinking
2.1 overall structure
The overall structure of the ...
Posted on Sat, 18 Jan 2020 07:22:30 -0500 by ethan6