Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

177
Views
Vue: Rendered list show selected checkboxes

I try to display my selected checkboxes, which I render like this:

 <pre>{{ JSON.stringify(selectedAttributes, null, 2) }}</pre>
            <ul
              class="list-unstyled"
              v-for="category in categories"
              :key="category.name"
            >
              <strong>{{ category.category_name }} </strong>
              <li
                v-for="attributes in category.attributes"
                :key="attributes.attribute_id"
              >
                <Field
                  as="input"
                  name="attribute"
                  type="checkbox"
                  class="form-check-input"
                  v-model="selectedAttributes"
                  :id="attributes.attribute_id"
                  :value="attributes.attribute_id"
                />
                <label class="form-check-label" for="attributes.attribute_id">
                  {{ attributes.attribute_name }}
                </label>
              </li>
            </ul>

...

  data() {
    return {
      selectedAttributes: [],
    };
  },

Unfortunately, the attribute_id of my selected checkboxes is not showing. Where is my mistake? enter image description here

Update: The data from my api looks like this: enter image description here

What I need here is, I want the user to check his preferred options and display the selected options in the JSON.stringify. The selectedAttributes should display the attribute_id of the chosen option.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Your data does not have attribute_id id property at all. Only attribute_name you can see at the image you provided

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!