D3.js string generator (V3 version)

Chord generator   The chord generator draws strings according to two arcs. There are five accessors, namely source(), target(), radius(), startAngle(), endAngle(), which return the same variables as the function name by default. If the default accessor is used, an arc is drawn, and its data composition should be as follows:   1   { 2 ...

Posted by forgun on Sun, 10 Nov 2019 18:07:07 +0100

Deep Understanding of JS Iteration Protocol-Handwritten Iterator

Iterable and Iterator Protocols Reference MDN:https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Iteration_protocols Iterable Protocol Iterable protocols allow JavaScript objects to define or customize their iteration behavior, such as (define) what values can be looped in a for..of structure.Some built-in types are built-in iter ...

Posted by sandrol76 on Sat, 09 Nov 2019 08:04:15 +0100

react.js avoid re rendering the entire page when typing (setState) in input/textareah

Background:Using setState to save value in the onChange method of < textarea > will result in input stuttering. The reason is that the user is always in setState when inputting, resulting in the whole page being re rendered all the time Main page: import React, { Component, } from 'react'; import { Input } from 'antd'; const { TextAre ...

Posted by smurl on Fri, 08 Nov 2019 20:56:47 +0100

Using html2canvas to upload pictures to generate posters

Link: Link descriptionUsing Vue + html2canvas + EXIF JS github address Online demo major function Upload pictures Operate on pictures: move, enlarge and shrink Synthetic Poster Specific functions: Upload pictures html: <input type="file" value="" accept="image/*" @click="getPhoto" id="image-input"> js getPhoto () { var imageInput ...

Posted by libertyct on Fri, 08 Nov 2019 19:14:40 +0100

Simple implementation principle of Express Middleware

After understanding the use of Express in the previous article, I will summarize the simple implementation principle of Express middleware. We know that Express middleware is a function by function, so how to make these functions execute orderly? We need to call the next function. In fact, the next function calls the next middleware function. T ...

Posted by j4IzbInao on Fri, 08 Nov 2019 16:15:58 +0100

vue+element creates a dynamic form, and dynamically generates rows and columns of the form

Create form form dynamically. There is a form create on the Internet, but I don't know how to use it. It's not successful. If you use it successfully, please leave a message below Finally, I used stupid methods to write general components for each form, and then use v-if to render the corresponding form, data, events and so on according to the ...

Posted by hermand on Thu, 07 Nov 2019 20:47:51 +0100

Components and routing in Vue

1. What is the component Component system is an important concept of Vue, because it is an abstraction, which allows us to build large-scale applications with small, independent and usually reusable components. Usually an application is organized in the form of a nested component tree. 1.1 declaration and use of components Global components ...

Posted by mike2098 on Thu, 07 Nov 2019 00:07:28 +0100

Reasons for slow loading of vue for the first time / slow loading after refresh and Solutions

Recently, a problem was found in the project. The loading speed of the page is very slow after each refresh, about 20s. In the development environment, it is very smooth, almost imperceptible. This article refers to the optimization of various schemes of Wangshan. 1. Close the map file generated during packaging In the config/index.js file, it ...

Posted by ragtek on Wed, 06 Nov 2019 03:31:21 +0100

[TS evolution history -- breaking the dawn] take you to TS step by step

By Valentino GagliardiTranslator: front-end wit Source: valentinog Last month, I spent 1300 yuan to buy Alibaba's server to learn node and its corresponding framework. Before the 11th, they had activities. The configuration of 1300 now costs only 86 yuan a year and 229 yuan for three years. I really think it's cost-effective. You can click the ...

Posted by ShawnD on Mon, 04 Nov 2019 02:08:05 +0100

js adaptive rem -- mainly applicable to mobile terminal

rem refers to the unit of font size relative to the root element (html), which can be used to achieve a powerful screen adaptation layout. The following main application is to adjust the font size of the root element based on js, so as to realize the adaptation of each size screen; //Design width: the actual width valu ...

Posted by aquayle on Sun, 03 Nov 2019 17:39:22 +0100