zoukankan      html  css  js  c++  java
  • vue

    列表渲染续

    <ul id="array-with-index" class="demo">
      <li v-for="(item, index) in items">
        {{ parentMessage }} - {{ index }} - {{ item.message }}
      </li>
    </ul>
    .demo {
      font-family: sans-serif;
      border: 1px solid #eee;
      border-radius: 2px;
      padding: 20px 30px;
      margin-top: 1em;
      margin-bottom: 40px;
      user-select: none;
      overflow-x: auto;
    }
    Vue.createApp({
      data() {
        return {
          parentMessage: 'Parent',
          items: [{ message: 'Foo' }, { message: 'Bar' }]
        }
      }
    }).mount('#array-with-index')

    <ul id="v-for-object" class="demo">
      <li v-for="value in myObject">
        {{ value }}
      </li>
    </ul>
    .demo {
      font-family: sans-serif;
      border: 1px solid #eee;
      border-radius: 2px;
      padding: 20px 30px;
      margin-top: 1em;
      margin-bottom: 40px;
      user-select: none;
      overflow-x: auto;
    }
    Vue.createApp({
      data() {
        return {
          myObject: {
            title: 'How to do lists in Vue',
            author: 'Jane Doe',
            publishedAt: '2020-03-22'
          }
        }
      }
    }).mount('#v-for-object')

  • 相关阅读:
    053-005
    053-002
    053-004
    Dynamic Programming: Fibonacci
    Some tips on using HashSet<T> and List<T>
    使用NPOI导出DataTable到Excel
    简简单单写个特效
    vue项目使用tinymce 适用于5.0版本
    封装AJAX
    全屏滑动效果
  • 原文地址:https://www.cnblogs.com/yongyuandishen/p/14912632.html
Copyright © 2011-2022 走看看