axios principle

1: Learn about axios Basic concepts: axios is an HTTP client based on promise for browsers and Node.js, or axios is an asynchronous Ajax request Library Based on promiseFeatures: (gitHub has a detailed introduction) 2: axios principle In essence, Axios is the function returned by Axios.prototype ...

Posted on Thu, 13 Feb 2020 23:17:06 -0800 by calevans

Why use promise

Original text: Why use promise   cause As we all know, the most headache of front-end development is to deal with asynchronous requests. Continue to write functions in the successful callback function, and in the long run, callback hell has formed. function load() { $.ajax({ url: 'xxx.com', data: 'jsonp' ...

Posted on Fri, 31 Jan 2020 13:30:37 -0800 by sdotsen

Design a perfect front-end authentication scheme from 0 to 1

Vue front-end authentication scheme, front-end and back-end separation Technology stack Front end Vue family bucket, backstage.net. requirement analysis Front end route authentication, shield address bar intrusion Routing data is managed by the background, and the front end only loads routes asynchronously according to fixed rules Authority co ...

Posted on Sat, 18 Jan 2020 19:29:31 -0800 by pulsedriver

vue authority management request module encapsulation

1. Write a unified url configuration file import { baseUrl } from './global' export default { method: 'get', // Base url prefix baseUrl: baseUrl, // Request header information headers: { 'Content-Type': 'application/x-www-form-urlencoded', 'Access-Control-Allow-Origin':'*', }, ...

Posted on Mon, 13 Jan 2020 22:00:28 -0800 by naboth_abaho

Using Vue framework to develop the mobile terminal project of qunar tourism network

Chapter VI development of the front page of tourism websites Home navigation bar Complete the layout of the page according to the design draft: Before writing code, let's introduce stylus, which is the same function as less and sass. It can help us to write css code quickly. Use the following comma ...

Posted on Sun, 12 Jan 2020 23:40:02 -0800 by robkir

Product classification page

After the data is displayed, it is found that the time column is a time stamp, so a global filter should be written to convert the time stamp into time /* Define a global filter to change the timestamp passed from the background into a custom event style */ Vue.filter('dateFormat', function (originVal) ...

Posted on Fri, 10 Jan 2020 23:25:45 -0800 by west4me

[technical translation] use Nuxt to generate static website

This week, we will translate some technical articles. This time, we expect to translate three articles as follows: Use Nuxt to generate static website(Generate Static Websites with Nuxt) How Web page content affects battery power consumption(How Web Content Can Affect Power Usage) Writing asynchronous tasks in modern JavaScript(https://web.dev ...

Posted on Mon, 06 Jan 2020 14:39:20 -0800 by Pavlos1316

QR code.js's QR code supports long press and scan on the mobile end and save to the mobile album

The company's project is front and back separation, The background frame is laravel, The front desk takes data from the background through the programming interface, The value is obtained through the foreground vue, First, read the interface data: $id = $params['id']; //Merchant information content $data = ...

Posted on Sat, 04 Jan 2020 02:43:39 -0800 by mrmitch

[React] summary (8) send Ajax request in React - axios | fetch | exercise - write a search request

Sending Ajax requests in React - use of axios React itself does not contain the code to send ajax, and generally uses third-party libraries. For example, axios, which is a library dedicated to ajax requests. It encapsulates the ajax of XmlHttpRequest object, and uses promise style writing method, which can be used in the cli ...

Posted on Thu, 02 Jan 2020 17:51:16 -0800 by Spudgun

[React] summarize part (9) three ways of communication between components: props and subscription publishing mechanism | subscribe | publish | rewrite the previous exercise

Two ways of communication between components Mode 1: pass through props 1. General data – > parent component transfers data to child component – > child component reads data 2. Function data – > subcomponent passes data to parent component – > subcomponent calls function 3. Common data is ...

Posted on Fri, 27 Dec 2019 07:22:59 -0800 by panic!