Showing
2 changed files
with
22 additions
and
13 deletions
1 | <template> | 1 | <template> |
2 | <div> | 2 | <div> |
3 | - <Form :model="formItem" :label-width="100"> | ||
4 | - <FormItem label="推荐商品池ID"> | ||
5 | - <Input v-model="formItem.input1" ></Input> | ||
6 | - </FormItem> | ||
7 | - <FormItem label="热销商品池ID"> | ||
8 | - <Input v-model="formItem.input2" ></Input> | 3 | + <Form :label-width="100"> |
4 | + <FormItem :label="i.poolName" v-for="i in formItem" :key="i.id"> | ||
5 | + <Input :value="i.poolId" @input="onUpdate"/> | ||
9 | </FormItem> | 6 | </FormItem> |
10 | </Form> | 7 | </Form> |
11 | </div> | 8 | </div> |
@@ -13,17 +10,26 @@ | @@ -13,17 +10,26 @@ | ||
13 | 10 | ||
14 | <script> | 11 | <script> |
15 | export default { | 12 | export default { |
16 | - props: ['data'], | 13 | + props: { |
14 | + list: { | ||
15 | + type: Array, | ||
16 | + default() { | ||
17 | + return [] | ||
18 | + } | ||
19 | + } | ||
20 | + }, | ||
17 | data() { | 21 | data() { |
18 | return { | 22 | return { |
19 | - formItem: { | ||
20 | - input1: '', | ||
21 | - input2: '' | ||
22 | - } | 23 | + formItem: this.list |
24 | + } | ||
25 | + }, | ||
26 | + methods: { | ||
27 | + onUpdate(i) { | ||
28 | + console.log(i) | ||
23 | } | 29 | } |
24 | }, | 30 | }, |
25 | mounted() { | 31 | mounted() { |
26 | - | 32 | + |
27 | } | 33 | } |
28 | 34 | ||
29 | } | 35 | } |
@@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
5 | </select-comp> | 5 | </select-comp> |
6 | 6 | ||
7 | <Modal v-model="show" title="商品池资源位"> | 7 | <Modal v-model="show" title="商品池资源位"> |
8 | - <tab-editor></tab-editor> | 8 | + <tab-editor :list.sync="data"></tab-editor> |
9 | </Modal> | 9 | </Modal> |
10 | </div> | 10 | </div> |
11 | </template> | 11 | </template> |
@@ -21,6 +21,9 @@ export default { | @@ -21,6 +21,9 @@ export default { | ||
21 | show: false | 21 | show: false |
22 | } | 22 | } |
23 | }, | 23 | }, |
24 | + mounted() { | ||
25 | + console.log(this.data); | ||
26 | + }, | ||
24 | methods: { | 27 | methods: { |
25 | onClick() { | 28 | onClick() { |
26 | this.show = true; | 29 | this.show = true; |
-
Please register or login to post a comment