Vue - component communication
Single layer component communication
Prop
The scope of the component instance is isolated. This means that the parent component cannot (and should not) be referenced directly within the template of the child component
Data. The data of the parent component can only be distributed to the child component through prop.
The su ...
Posted by PTS on Mon, 30 Mar 2020 23:53:37 -0700
Vue - - Nuxt.js for the whole family
1. Directory structure
2. Aliases
On the vue page of nuxt.js, you can use ~or ~~ if you need to import resources from a directory such as assets or static.
3. Routing
Nuxt.js automatically generates the routing configuration for the vue-router module based on the pages directory structure. To use routing between pages, we recomm ...
Posted by nemesis.2002 on Sun, 29 Mar 2020 19:53:29 -0700
Brother component communication of non parent-child component communication in Vue cli project
First, draw on official documents
Sometimes, two components of a non parent-child relationship need to communicate with each other. In a simple scenario, you can use an empty Vue instance as the event bus:
var bus = new Vue()
//Trigger events in component A
bus.$emit('id-selected', 1)
//Listen for events in the hook created by ...
Posted by varun_146100 on Fri, 27 Mar 2020 09:24:05 -0700
vue schedule
Following this kind of schedule form, use vue to complete the display effect of this similar schedule
First, put the weekly appointment information into an array with a length of 7. 0-6 means Sunday to Saturday
Create an array of 33 * 7
Each cell 1 indicates that the time is idle, and null indicates that the time has been occupied. If i ...
Posted by steves on Thu, 26 Mar 2020 11:26:31 -0700
axios in vue
axios in vue
1.install axios
npm: $ npm install axios -S
cdn:
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
2. Configure axios
//Create a new api/index.js file in the project to configure axios
api/index.js
//Copy code
import axios from 'axios';
let http = axios.create({
baseURL: ...
Posted by neerav on Thu, 26 Mar 2020 10:04:12 -0700
vue nested route
1. Reasons for existence
It is more simple to express the relationship between multiple nested components. A rendered component can also contain < router View >
const User={
template:`
<div class="user">
<h2>user {{ $route.params.id }}</h2>
<router-view></router-view& ...
Posted by alvinho on Tue, 24 Mar 2020 07:50:15 -0700
40 line program integrates the response of Vue3 into React for state management
This article refers to the original- http://bjbsair.com/2020-03-22/tech-info/2095/
Preface
Vue next is the source warehouse of vue3. Vue3 uses lerna to divide the package, while the responsive capability @ vue/reactivity is divided into a separate package.
If we want to integrate it into React, is it feasible? Let's have a try.
Use example
If ...
Posted by double on Tue, 24 Mar 2020 01:02:28 -0700
90% of the front end will step on the pit, did you get it
This article refers to the original- http://bjbsair.com/2020-03-22/tech-info/2149/
Written in front
In the era of mobile development, the front-end students just bid farewell to the bald Internet Explorer, but found that the mobile Internet era that they had been looking forward to for a long time was not as beautiful as they imagined. It's h ...
Posted by always_confused on Mon, 23 Mar 2020 21:17:45 -0700
Nuxt.js ajax operation of programmer's necessary programming
Nuxt.js(4) ajax operation for programmers
1, Integrate axiox
When building a project, if you select the axios component, nuxt.js will automatically integrate with axios.
Integration effect:
1) package.json has axios version
2) nuxt.config.js add axios as a module
Common configuration, modify nuxt.config.js to config ...
Posted by --ss-- on Sun, 22 Mar 2020 08:37:51 -0700
JS implementation of bottom touching event in rolling area
Effect
Paste the effect display:
Implementation ideas
In terms of style, we don't need to elaborate. The scrolling area is set to a fixed height. Set overflow-y: auto to achieve this.
Next let's look at the implementation of js, which is also very simple. The trigger condition is: visible height + rolling distance > = actual height. I will u ...
Posted by gilang4 on Sat, 21 Mar 2020 02:44:40 -0700