How does Axios cancel a sent request?

Recently, I encountered a problem that if the second request is faster than the first one when sending the same request in succession, then the data of the first request is actually displayed, which will result in inconsistency between the data and the content I choose. Solution: When subsequent requests are sent, determine whe ...

Posted by dcgamers on Wed, 30 Jan 2019 00:03:16 -0800

Make a personalized switch switch switch button

Demand Background: The company has a Wechat widget project, which requires a large number of unique switch buttons. Like the switch button, the widget widget can't fill in the text. Therefore, directly, and the framework of the widget is based on the mpvue of vue. The time of mpvue coming out is also short. It is estimated that ...

Posted by melrse on Tue, 29 Jan 2019 23:36:14 -0800

Click on login to refresh the page

Click events are added to login, but the page will be refreshed when jumping, but it is possible to click Enter. Among them, the landing tag reads like this <a class="lgBut" id="btn_login" href="" >Sign in</a> This is the way below. $("btn_login").click(function(){ var USERNAME=$("#USERNAME").val(); ...

Posted by beginPHP on Tue, 29 Jan 2019 22:00:15 -0800

Introduction to TypeScript

Introduction to TypeScript Before using TypeScript, we need: Installing TypeScript uses nmp-v to check whether npm is installed Use tsc-v to check whether the TypeScript environment is installed or not, use NPM install-g type script installation environment, use tsc test.ts to mutate the TypeScript.ts file into JavaScript.js ...

Posted by rcity on Tue, 29 Jan 2019 04:39:14 -0800

Prototype and Inheritance of JavaScript

1. Implementation examples: function Person(name, sex) { this.name = name; this.sex = sex; } Person.prototype = { name:'Anonymous person', sex:'Unknown', nation:'Mars', getName: function() { return this.name; }, getSex: function() { return this.sex; }, getNation: functio ...

Posted by nitation on Mon, 28 Jan 2019 13:21:14 -0800

js inheritance-constructor inheritance, call apply change this to prototype chain inheritance, mixed inheritance

1. Constructor Inheritance function Person(name,age){ this.name = name; this.age = age; this.run = function(){ console.log('run....'); } } function YPerson(name,age,color){ this.method = Person;//this.method points to the constructor Person pointed to by Person this.method(name,age); //Executing this.met ...

Posted by Sealr0x on Sun, 27 Jan 2019 19:39:14 -0800

Js array comparison

Recently, a function has been made, the balance sheet, which requires that the historical version be compared with the current version. If the data changes in the new version are marked red, the old data added in the new version should be empty, and the old data deleted in the old version should also be empty. Thought: Since a ...

Posted by devang23 on Sun, 27 Jan 2019 16:45:15 -0800

Two-way data binding (getter and setter) with computer in vue

Vue is known as a framework to achieve data bidirectional binding, but in fact, in daily development, we use the most is v-model to associate data (vue instance) with view, to achieve data updates, view automatic refresh effect. However, as far as mobile Chengdu is concerned, the effect of two-way data binding is not particular ...

Posted by fr0stx on Sun, 27 Jan 2019 13:54:14 -0800

Custom Bullet Window with Show Animation

Small programs are similar to template engines such as Vue.js and Angular.js. This kind of MVVM data-driven framework can quickly develop projects. However, when doing small programs, one of the problems we will encounter is that the pop-up window is very rigid and there is no transition animation. The following source code doe ...

Posted by eXodus on Sun, 27 Jan 2019 11:24:14 -0800

Call and data transfer between Vue parent and child components

Call and data transfer between Vue parent and child components Definition of parent and child components Parent and child components of two files Definition of parent and child components The official website of vue has written some definitions about parent-child components and the transfer of values. I won't go into too ...

Posted by setic on Sat, 26 Jan 2019 17:12:15 -0800