<commit_before><!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Vue-task</title>
    <script src="js/vue.js"></script>
    <script type="text/javascript">
      var data = {
          title: '任务列表',
          task: {'state': 0, 'content': ''},
          todos:[
            {
              'state':2,
              'content': '任务0'
            },
            {
              'state':1,
              'content': '任务1'
            },
            {
              'state':1,
              'content': '任务2'
            }
          ]
      };
    </script>
    <style type="text/css">
      .done{
        text-decoration: line-through;
        color: red;
      }
    </style>
  </head>
  <body>
    <div id="app">
        <h1>{{title}}</h1>
        新任务：<input type='text' @keyup.enter='add' v-model='task.content'>
        <ol>
          <li 
            v-for='todo in todos'
            :class="todo.state == 2 ? 'done' : ''" @click='chgStage(todo)'>{{todo.content}}<button @click='del(todo)'>-</button></li>
        </ol>
        
    </div>
  </body>
  <script type="text/javascript">
      var demo = new Vue({
          el: '#app',
          data: data,
          methods: {
            add: function(){
              this.todos.push(this.task);
              this.task = {'state': 0, 'content': ''};
            },
            chgStage: function (task) {
              task.state = task.state == 2 ? 1 : 2;
            },
            del: function (task) {
              this.todos.$remove(task);
            }
          }
      })
  </script>
</html>
<commit_msg>'新增：根据任务状态查看任务'<commit_after><!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Vue-task</title>
    <script src="js/vue.js"></script>
    <script type="text/javascript">
      var data = {
          title: '任务列表',
          state: -1,
          task: {'state': 1, 'content': ''},
          todos:[
            {
              'state':2,
              'content': '任务0'
            },
            {
              'state':1,
              'content': '任务1'
            },
            {
              'state':1,
              'content': '任务2'
            }
          ]
      };
    </script>
    <style type="text/css">
      .done{
        text-decoration: line-through;
        color: red;
      }
    </style>
  </head>
  <body>
    <div id="app">
        <h1>{{title}}</h1>
        新任务：<input type='text' @keyup.enter='add' v-model='task.content'>
        <ol>
          <li 
            v-for='todo in todos'
            :class="todo.state == 2 ? 'done' : ''" @click='chgStage(todo)' v-if='state < 0 || todo.state == state'>{{todo.content}}<button @click='del(todo)'>-</button></li>
        </ol>
        <input type='radio' name='state' id='all' value='-1' v-model='state'><label for="all">全部</label>
        <input type='radio' name='state' id='todo' value='1' v-model='state'><label for="all">未完成</label>
        <input type='radio' name='state' id='done' value='2' v-model='state'><label for="all">已完成</label>
    </div>
  </body>
  <script type="text/javascript">
      var demo = new Vue({
          el: '#app',
          data: data,
          methods: {
            add: function(){
              this.todos.push(this.task);
              this.task = {'state': 1, 'content': ''};
            },
            chgStage: function (task) {
              task.state = task.state == 2 ? 1 : 2;
            },
            del: function (task) {
              this.todos.$remove(task);
            }
          }
      })
  </script>
</html>

{'fraction_non_alphanumeric': 0.18923465096719932, 'fraction_numerical': 0.009812167087188113, 'mean_word_length': 1.4272108843537414, 'pattern_counts': {'":': 0, '<': 71, '<?xml version=': 0, '>': 70, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5025654', 'n_tokens_mistral': 1204, 'n_tokens_neox': 1190, 'n_words': 213}