Conditional compilation of E chat SDK under TypeScript (using JS conditional compile loader plug-in)

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 1. Background: 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 scratch (2020 handlebar)

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) Selective reading The novice sug ...

Posted on Tue, 09 Jun 2020 04:36:14 -0400 by TitanKing

Introduction to zero knowledge proof contract and application development of Ethereum

In this tutorial, we will learn how to develop a zero knowledge identification DApp based on Ethereum, how to develop a zero knowledge circuit of circle, how to generate and verify a solid zero knowledge smart contract, and how to generate zero knowledge evidence under the chain using Javascript, and provide a complete source code download at t ...

Posted on Fri, 29 May 2020 06:04:06 -0400 by Toonster

vue + typescript, defining global variables or methods

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

Master the types of TS tools, so that you can develop with half the effort

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 front end unit test tool

Jest and enzyme front end unit testing tools What is Jest? Jest is a delightful JavaScript testing framework that focuses on simplicity. It is suitable for projects using Babel, TypeScript, Node, React, Angular, Vue, etc! Characteristic Zero configuration snapshot Isolated Great api Introduction Use yarn to install jet: yarn add --dev jest ...

Posted on Tue, 28 Apr 2020 21:41:17 -0400 by Wave

Implement Online Excel Editing System

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

Learning TypeScript 0x3 Object Oriented Programming

SOLID Principles 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

Wangcai bookkeeping project - Implementation of Money.vue component

1. Implement the Vue component of TypeScript. Take Types component as an example to rewrite JS writing <template> <div> <ul class="types"> <li :class="type === '-' && 'selected'" @click="selectType('-')">expenditure</li> <li :class="type === '+' && 'selected'" @cl ...

Posted on Fri, 07 Feb 2020 07:02:29 -0500 by angelkay73

Using typescript to transform koa development framework

Original address: Using typescript to transform koa development framework Strong TypeScript development experience and maintenance projects have obvious advantages over JavaScript, so it is necessary to transform the commonly used scaffolds. 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