File tree Expand file tree Collapse file tree 1 file changed +16
-14
lines changed
templates/vue/components/foo Expand file tree Collapse file tree 1 file changed +16
-14
lines changed Original file line number Diff line number Diff line change 49
49
</thead >
50
50
<tbody >
51
51
<tr v-for =" item in items" >
52
- <td ><router-link :to =" {name: '{{{titleUcFirst}}}Show', params: { id: item['@id'] }}" >\{{ item['@id'] }}</router-link ></td >
52
+ <td ><router-link v-if = " item " :to =" {name: '{{{titleUcFirst}}}Show', params: { id: item['@id'] }}" >\{{ item['@id'] }}</router-link ></td >
53
53
{{#each fields}}
54
- <td ><router-link v-if =" item['{{{ name }}}'] " :to =" {name: '{{{titleUcFirst}}}Show', params: { id: item['@id'] }}" >\{{ item['{{{ name }}}'] }}</router-link ></td >
54
+ <td ><router-link v-if =" item" :to =" {name: '{{{../ titleUcFirst}}}Show', params: { id: item['@id'] }}" >\{{ item['{{{ name }}}'] }}</router-link ></td >
55
55
{{/each}}
56
56
<td >
57
57
<router-link :to =" {name: '{{{titleUcFirst}}}Show', params: { id: item['@id'] }}" >
75
75
</template >
76
76
77
77
<script >
78
- import { mapGetters , mapActions } from ' vuex' ;
78
+ import { createNamespacedHelpers } from ' vuex' ;
79
79
80
- export default {
81
- computed: mapGetters ([
82
- ' items' ,
83
- ' view'
84
- ]),
85
- methods: mapActions ([
86
- ' getPage'
87
- ]),
88
- created () {
89
- this .$store .dispatch (' getItems' )
80
+ const { mapActions , mapGetters } = createNamespacedHelpers (' {{{lc}}}/list' );
81
+
82
+ export default {
83
+ computed: mapGetters ([
84
+ ' items' ,
85
+ ' view'
86
+ ]),
87
+ methods: mapActions ([
88
+ ' getPage'
89
+ ]),
90
+ created () {
91
+ this .$store .dispatch (' {{{lc}}}/list/getItems' )
92
+ }
90
93
}
91
- }
92
94
</script >
You can’t perform that action at this time.
0 commit comments