Basic use of dayjs time processing library

Day.js Is a lightweight JavaScript time and date processing library, and Moment.js The API design of is consistent. This article only introduces some common operations. For details of internationalization, plug-ins, customization and other advanced contents, please refer to the official documents. Its main characteristics are as follows: A ...

Posted by bond00 on Wed, 03 Jun 2020 18:23:55 +0200

Illustration of Promise implementation principle -- Promise static method implementation

This article starts with WeChat official account of vivo Internet technology.Link: https://mp.weixin.qq.com/s/Lp_5BXdpm7G29Z7zT_S-bQ By: Morrain Provides the Promise object. For more information about Promise, please refer to teacher Ruan Yifeng's Promise object for getting started with ES6. When learning Promise, many students know it ...

Posted by Dragonfly on Mon, 01 Jun 2020 05:18:43 +0200

Add abort function to promise

There are only three states of project: pending, resolve, and reject. Once an asynchronous commitment is issued, it can only succeed or fail after it has been pending, and cannot be cancelled in the middle. There are two ways to provide abort function for promise: Manually implement abort. After the trigger is cancelled, the data returned as ...

Posted by ibechane on Wed, 27 May 2020 17:12:29 +0200

Web development, only JS can complete the development of Express query API interface

Some netizens left a message saying that they want to call the express bird API interface to realize Express query, but they don't understand the back-end development, JAVA, PHP, C and python. They asked me if I could realize express interface query, and I said what would you do, he said, I only know a little JS, I replied that it's enough. No ...

Posted by itbegary on Tue, 19 May 2020 16:19:13 +0200

Understanding of offset, curl and visibility

Offset Offset dimension is an important concept in javascript. offsetLeft, offsetTop, offsetHeight and offsetWidth are the four attributes related to offsets. Of course, there is also an offset reference -- positioning the parent offsetParent. This article will introduce this part in detail                 ...

Posted by Helljumper on Sat, 09 May 2020 10:09:11 +0200

Websocket live room chat tutorial - go easy to quickly implement chat room

This tutorial and the full set of source code have been open-source on the OSChina code cloud and will be updated continuously. Please visit the latest version https://gitee.com/goeasy-io/GoEasyDemo-Live-Chatroom.git That fire has been broadcast live in the last two years. It's really indescribable! Often a friend asks, I want to realize a live ...

Posted by Zup on Tue, 21 Apr 2020 05:25:39 +0200

Layer UI clipping plug-in clipper one page calls many times to solve the problem

Problem: when calling multiple clipper plug-ins on a page, we will find that although we have declared each id, when we click the corresponding area, the clipper clipping area will pop up, but when we click save after selection, we will find that the clipped image will only appear in the last declared id. Although we can set a click event in ea ...

Posted by !jazz on Tue, 07 Apr 2020 17:13:02 +0200

Garbage collection mechanism of weakSet

WeakSet object Difference: WeakSet is similar to Set in that it is a de reordered aggregation of data. But there are two differences: A WeakSet member can only be an object, not data of other types. The WeakSet member objects are all weak references, that is, the garbage collection mechanism will not consider the reference of the WeakSet obj ...

Posted by jlryan on Sat, 04 Apr 2020 13:07:24 +0200

Wechat app learning notes music player (next, previous, auto next)

Wechat applet learning notes (IX) music player (next, previous, automatic next) In order to realize the function of automatic next song, next song and previous song, and realize the circular play of the list, it must be clear that the current play is the first song in the list. Therefore, set a data record in the program that the currently pla ...

Posted by monk.e.boy on Mon, 30 Mar 2020 15:54:19 +0200

Class component details

1, class component creation method import React from 'react'; class B extends React.Component { constructor(props){ super(props); } render(){ return ( <div>hi</div> ) } } 2, Props external data class Parent extends React.Component { constructor(props){ super(props) this.state = {name:'frank'} ...

Posted by newcastle_unite on Wed, 18 Mar 2020 09:54:50 +0100