zoukankan      html  css  js  c++  java
  • vue

    <template>
      <div class="todo-item" :class="{'is-complete':todo.completed}">
          <p>
              <input type="checkbox" @change="markComplete">
              {{todo.title}}
          </p>
      </div>
    </template>

    <script>
    export default {
        name:'todo',
        props:["todo"],
        methods:{
            markComplete(){
                this.todo.completed = !this.todo.completed
                console.log(this.todo);
            }
        }
    }

    </script>

    <style scoped>
    .todo-item{
        background: #f4f4f4;
        padding: 10px;
        border-bottom: 1px dotted #ccc ;
    }

    .is-complete{
        text-decoration: line-through
    }

    .del{
        background: #ff0000;
        color: #fff;
        border: none;
        padding: 5px 9px;
        border-radius: 50%;
        cursor: pointer;
        float: right;
    }
    </style>
  • 相关阅读:
    2017年暑期实习生招聘(百度)——两道编程题
    携程笔试中的一道编程题
    软工假期预习作业1
    假期作业
    FAFU 1557
    HDU 1028
    POJ 3126
    HDU5108
    POJ 1716
    HDU4790
  • 原文地址:https://www.cnblogs.com/500m/p/11770723.html
Copyright © 2011-2022 走看看