1import ChildForm from './components/ChildForm'
2
3new Vue({
4 el: '#app',
5 data: {
6 item: {}
7 },
8 template: `
9 <div>
10 <ChildForm :item="item" ref="form" />
11 <button type="submit" @click.prevent="submit">Post</button>
12 </div>
13 `,
14 methods: {
15 submit() {
16 this.$refs.form.submit()
17 }
18 },
19 components: { ChildForm },
20})
21