0

enter image description here

I am simply trying do displat this number found in my data model, but it is not an array so not sure what needs to be added for this to display. For arrays normally generatedData.Number would work, but not in this case. Any assistance would be great!

ew Vue({
  el: "#app",
  data: {
  generatedData:Object,Number:"14444"

  },
  methods: {
    toggle: function(todo){
        todo.done = !todo.done
    }
  }
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>

<div id="app">
  my number is {{generatedData.Number}}
</div>

2
  • in your current example, Number is not a property of generatedData, it's its own property and would be access by {{ Number }}. Commented Mar 4, 2022 at 19:07
  • @StevenB. see attached photo. This is how it looks in generatedData Commented Mar 4, 2022 at 19:14

1 Answer 1

1

If I understood you correctly try like following snippet:

new Vue({
  el: "#app",
  data() {
    return {
      generatedData: {
        Code: 'LA_100',
        isActive: true, 
        Name: '44445',
        Number: "14444"
      }
    }
  },
  methods: {
    toggle: function(todo){
        todo.done = !todo.done
    }
  }
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>
<div id="app">
  my number is {{ generatedData.Number }}
</div>

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.