Home > Web Front-end > JS Tutorial > How to use v-model in vue to achieve parent-child component communication

How to use v-model in vue to achieve parent-child component communication

亚连
Release: 2018-06-21 17:24:59
Original
2054 people have browsed it

vue.js is a library for building data-driven web interfaces. The goal of Vue.js is to enable responsive data binding and composed view components with the simplest possible API. The following article mainly introduces relevant information about the communication implementation of v-model parent and child components in the vue project. Friends in need can refer to it.

Preface

In our vue project, we often have such a requirement. The parent component binds v-model, and the sub-component input changes the parent The value bound to component v-model. Many friends are not very clear about this operation, which requires a deeper understanding of v-model. Let’s talk about v-model today.

Vue’s two-way data binding

The v-model command can only be used in ,