当前位置:网站首页>Presentation of attribute value of an item

Presentation of attribute value of an item

2022-07-05 06:17:00 hamimelon2020

<template>
<div>
    <ul id="v-for-object" class="demo">
  <li v-for="value in myObject" :key="value.id">
    {
    {
     value }}
  </li>
</ul>
</div>
</template>

<script>
export default {
    
    name: 'item',
    data() {
    
        return {
    
            myObject: {
    
                title: 'How to do lists in Vue',
                author: 'Jane Doe',
                publishedAt: '2016-04-10'
      }
    }
  }
}
</script>

No, ul Only li There are three points in the list symbol .

<template>
<div>
    
  <li v-for="value in myObject" :key="value.id">
    {
    {
     value }}
  </li>

</div>
</template>

<script>
export default {
    
    name: 'item',
    data() {
    
        return {
    
            myObject: {
    
                title: 'How to do lists in Vue',
                author: 'Jane Doe',
                publishedAt: '2016-04-10'
      }
    }
  }
}
</script>

原网站

版权声明
本文为[hamimelon2020]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202140617451612.html