I am really stuck with this. I created the Vue (2.0) component, which consists of child components, all of this is Webpacked, etc. For example, this is the parent element:
<div> <h1>This is just a title for lulz</h1> <rowcomponent v-for="row in rows" :row-data="row"></rowcomponent> </div>
which has a rows
registration that looks something like this:
rows: [{ sometext: "Foo"} , { sometext: "Bar" }]
So my string component is as follows:
<div>{{ this.sometext }} <button @click="deleteRow">Delete Row</button></div>
And I feel that it is very simple to set the method on rowcomponent
, something like this:
deleteRow() { this.delete(); }
Do I need $ emit something parent with the row index in it to remove it? It drives me crazy. All the examples seem to suggest that this will be easy to do, but not if you have child components that want to remove themselves.
source share