vue sub component transfers data to parent component (example of adding and subtracting)

Here's a common way for a subcomponent to pass values to its parent. Here is an example of addition and subtraction to explain the principle. As shown in the figure below: The value of the parent component is 0 when there is no operation When the plus sign is clicked, the value of the parent component is 1 When you ...

Posted by sinbad on Tue, 31 Mar 2020 00:31:29 -0700

On the value passing problem of parent-child components of vue

Create three Vue components - index.vue (parent component), son1.vue (child component), son2.vue (child component) Set the path of the parent component in the router file (the child component does not need to set the route); Page conversions between parent and child components are not routed The parent component passes the d ...

Posted by ElectricShaka on Tue, 31 Mar 2020 00:25:28 -0700

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