Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to solve the value transfer problem of vue parent-son template

Shulou Source: shulou.com Published: 2022-05-31 12:07:11 10月03日 Update

This article introduces the relevant knowledge of "how to solve the value transfer problem of vue father and son template". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

The specific code is as follows:

Title / / introduce the subtemplate of vue (function () {/ / two) let three = {props: ["data", "ide"], methods: {del (I) {this.$emit ("del", I)}}, template: `{{data}} {{ide} X`} / / subtemplate let two of one = {props: ["data", "ide"], components: {three}, methods: {dede (I) {this.$emit ("del", I)}}, template: ``} / / parent template let one = {data () {return {newsData: [{title: "News one"}, {title: "News one}]}}, components: {two}, methods: {delete2 (I) {this.newsData.splice (iPol 1)) }, template: `one1`}; let vm = new Vue ({el: "# app", components: {one}}) ()

Running result:

This is the end of the content of "how to solve the value transfer problem of vue father-son template". Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Templates news father and son questions content more knowledge practicality learning next code dilemma reality situation articles cases results editing websites industry Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB NVidia Shulou Technology Microsoft Docker