R
R
Richard Millie2019-11-04 13:29:27
JavaScript
Richard Millie, 2019-11-04 13:29:27

How to show data from an array of objects in a list?

There is a function that receives the policies[] array:

getPolicies() {
                    let self = this;
                    HttpService.methods.get('/policies')
                        .then(function (response) {
                            self.policies = response.data.data
                            console.log(self.policies);
                        })
                        .catch(function (error) {
                            console.log(error);
                        })
                }

And there is this checkbox menu:
<div class="dropdown-checkbox form-group">
                    <label class="label-title"><p>Select</p></label>
                    <ul>
                      <li><label><input value="1"
                                        type="checkbox">1</label></li>
                      <li><label><input value="2"
                                        type="checkbox">2</label></li>
                      <li><label><input value="3"
                                        type="checkbox">3</label></li>
                    </ul>
                  </div>

How to show data from policies[] array in menu for each item?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
McBernar, 2019-11-04
@McBernar

Bind with a model or via v-for - I don’t really understand what exactly should be a list - menus or checkboxes.

N
Nikolai Chuprik, 2019-11-04
@choupa

Reading the Vue Guide

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question