axios interception, api unified management
brief introduction
The encapsulation of axios and the unified management of api interface are actually designed to help us simplify the code and facilitate the later update and maintenance.
In the vue project, we usually use the axios library to interact with the background to obtain data. It is an http Library Based on promise, which can run ...
Added by nschmutz on Thu, 03 Feb 2022 07:13:03 +0200
8, Event handling -- review notes of warm boiled water
preface
The notes are miscellaneous this time
1, Basic usage of events in Vue
(1) Review event usage in native JavaScript
Three elements Get event source (which object is triggered) Binding event, event type (how to trigger, click or keyboard input, etc.) Add event handler (what to run)
Using events in this way is complicated. Let's lo ...
Added by jstinehelfer on Thu, 03 Feb 2022 06:43:13 +0200
Hand to hand teaching you to achieve a simple vue, start writing dep and watcher
Beep, beep, beep
In the previous article, we implemented an Observer. In this section, we will talk about the implementation of dep and watcher. As before, at the end of the article, I wrote a simple beta version of js for you to read the text of this section while testing.
Let's talk about dep first
dep is our dependency collector. You will kn ...
Added by designationlocutus on Thu, 03 Feb 2022 06:11:10 +0200
The CDN of Vue3 series introduces dependent packages to optimize the packaging rate
be careful!!! be careful!!! be careful!!! This article is based on Webpack packaging
I summary
Benefits of using CDN
Relieve the pressure on the server and allocate the requests when the first screen is loaded to other serversOptimize the packaged verdor JS too big problemSpeed up the first screen loadingSpeed up packaging In particul ...
Added by nitromaster on Thu, 03 Feb 2022 04:24:51 +0200
Django+Vue realizes the operation of adding, deleting, modifying and querying
1, Static routing
urlpatterns attribute
urlpatterns is a global variable in the routing file, which is used to store the mapping relationship between routing and view functions
The request URL initiated by the user will first enter the URLs under the main control directory Py file
First find URLs The urlpatterns global variable under py, wh ...
Added by pornophobic on Thu, 03 Feb 2022 03:58:28 +0200
vue bidirectional data binding principle
vue responsive principle
Data driven
Data responsive: according to the model, it is just a common JavaScript object. When we modify the data, the view will be updated, avoiding frequent DOM operations and improving development efficiency. This is different from Jquery, which operates DOM frequently
Bidirectional binding:
Data changes, view ...
Added by kevdoug on Thu, 03 Feb 2022 03:56:39 +0200
VUE learning, ref attribute, props configuration item, minix mixing, custom plug-in, scoped style
VUE learning (13), ref attribute, props configuration item, minix mixing, custom plug-in, scoped style
1, ref attribute
<template>
<div>
<h1 v-text="msg" ref="title"></h1>
<button ref="btn" @click="showDOM">Click on the top of my output DOM element</button>
<School ref="sch"/>
</div>
< ...
Added by ManInBlack on Wed, 02 Feb 2022 17:03:12 +0200
Vue router routing guard and authentication
First, let's understand the routing guard:
Routing guard is a bit similar to ajax request interception, which is to stop you before sending the request, and then send the request. The reason here is the same; It is simply understood that before you enter the route, first stop you and check you; Of course, routing guards not only stop you befor ...
Added by mikes127 on Wed, 02 Feb 2022 12:51:29 +0200
Use axios interceptor to solve [front-end concurrency conflict]
preface
Some interfaces in the project will be slow when calling the third party, and repeated requests will occur in a short time
There are also users who submit data many times in a short time
There will be concurrency conflicts, which can be intercepted at the front end
At present, I have summarized two methods:
The first scheme: a ...
Added by easyedy on Wed, 02 Feb 2022 06:13:28 +0200
Release your own front-end package with vite+lerna and verdaccio
prefaceYears ago, I made a project similar to user portrait, which has independent functions and may be embedded by many projects as a functional module, so I naturally thought of making this project into a component output. Vue cli provides Library packaging mode Therefore, I only need to copy the packaged files to other projects after each de ...
Added by Simplicity on Wed, 02 Feb 2022 05:42:37 +0200