Vuex 2.0 source code analysis
I. Preface
When we use Vue.js to develop a medium to large single-page application, we often encounter the following problems:
How to let multiple Vue components share state
How to communicate between Vue components
Usually, when the project is not very complex, we will use the global event bus to solve it, but as the complexity i ...
Added by dcf1023 on Tue, 21 May 2019 02:43:01 +0300
Vuejs family barrel series (2) - - Ajax request
brief introduction
vue and ajax
AJAX, namely "Asynchronous Javascript And XML" (Asynchronous Javascript And XML), refers to a web page development technology for creating interactive web applications.
Basic usage of ajax
Vue itself does not support sending AJAX requests. It needs to be implemented with jquery, vue-resource s ...
Added by JeffK on Sun, 19 May 2019 12:04:05 +0300
React (7) Asynchronous data change (setState is asynchronous behavior)
Unlike Vue, React's settings are asynchronous.
13. setState is an asynchronous behavior
setState()
This is an asynchronous operation, such as:
class HelloWord extends React.Component {
constructor(props) {
super(props);
this.state = {
count: 0
}
this.clickCountAsync = this.clickCountAsy ...
Added by Buddha443556 on Sun, 19 May 2019 03:46:29 +0300
VUE2.0 Picture Upload Function (Mobile End)
This paper mainly introduces the realization of VUE2.0 image upload function. The principle is to achieve this effect through js control and input tag, without loading other components.
The results are as follows:
1.DOM code
1.1 input tag
Because we upload pictures by input tag, but the style of input tag is ugly, so ...
Added by lunarul on Sat, 18 May 2019 18:32:21 +0300
Vuex and the use of several component Communications
Let's start with a simple German example
target.png
A simple application with buttons and a counter.Pressing the button increments the counter.While this is easy to achieve, the goal is to understand the basic concepts.
problem.dot.png
Suppose you have two components in your application:
1. A button (the source of ...
Added by The Saint on Fri, 17 May 2019 23:52:21 +0300
[Refactoring] Spring Cloud OAuth No Token Call Source Encapsulation
background
Refactoring - Improves the design of existing code so that software can be more easily understood and modified.
Book back Source Parsing for Token Pass-through within Spring Security OAuth Micro-Service In this article, there is no token call process, the code is constantly improving and its refactoring process.
The requirements are ...
Added by LaWr3nCe on Fri, 17 May 2019 10:57:55 +0300
Vue Core Knowledge-Use Scenarios and Methods of computed and watch
computed
Do not use computed
Simple string splicing
import Vue from 'vue'
new Vue({
el: '#root',
template: `
<div>
<span>Name: {{firstName + ' ' + lastName}}</span>
</div>
`,
data: {
firstName: 'Jokcy',
lastName: 'Lou'
}
})
Using computed
new Vue({
el: '#ro ...
Added by mk1200 on Fri, 17 May 2019 09:57:22 +0300
Collection of JavaScript, Object-Oriented Programming (2)!
Today I went on to write the last one. Yesterday I was so tired this week that I rushed to work overtime every day. At 12 o'clock yesterday, my neck began to ache. Okay, no nonsense. It's time to start
inherit
Inheritance: Subclasses inherit attributes and methods in parent classes, which do not require implementation in subclasses
Types of i ...
Added by unstable_geek on Thu, 16 May 2019 20:12:06 +0300
vue hook function (soft text)
Preface:
The hook is like dividing a person's birth to death into stages. You must name at birth, not at the stage of adulthood or death. Or if you want to make an appointment at birth, you can't. The same is true of components, whose internal structure is different at each stage. So a specific hook can do something specific, s ...
Added by rachelk on Thu, 16 May 2019 09:43:46 +0300
Mobile h5 monitors browser return operations (currently used in react projects)
Preface
1. Mainly return is the default browser return event is to return to the previous page.
2. Processing all kinds of pop-ups on the page, clicking on physical return should hide these pop-ups instead of returning directly to the page.
3. To sum up the problems, h5 should hope to monitor the return events and do some p ...
Added by Daisy Cutter on Thu, 16 May 2019 05:25:39 +0300