chrome 开发者模式

<!DOCTYPE html>
<html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<script src="vue.js"></script>
<link rel="stylesheet" href="bootstrap.min.css">
<head>
</head>
<div id="app">
  <div class="panel panel-primary">
    <div class="panel-heading">
      <h3 class="panel-title">添加品牌</h3>
    </div>
    <div class="panel-body form-inline">
      <label>
        ID:
        <input type="text" class="form-control" v-model="id">
      </label>
      <label>
        Name:
        <input type="text" class="form-control" v-model="name">
        <input type="button" value="添加" class="btn btn-primary" @click="add">
      </label>
    </div>
  </div>
  <table class="table table-bordered table-hover table-striped">
    <thead>
      <tr>
        <td>ID</td>
        <td>Name</td>
        <td>Ctime</td>
        <td>Operation</td>
      </tr>
    </thead>
    <tbody>
      <tr v-for="item in list" :key="item.id">
        <td>{{ item.id }}</td>
        <td>{{ item.name }}</td>
        <td>{{ item.ctime  }}</td>
        <td>
          <a href="#" @click.prevent="del(item.id)">删除</a>
        </td>
      </tr>
    </tbody>
  </table>
</div>
<body>
<script>
  var vm = new Vue({
    el:'#app',
    data:{
      id:'',
      name:'',
      list:[
        {id:1,name:'奔驰',ctime: new Date()},
        {id:2,name:'宝马',ctime: new Date()},
      ]
    },
    methods:{
      add(){
        var car = {id:this.id,name:this.name,ctime:new Date()};
        this.list.push(car);
        this.id = this.name = '';
      },
      del(id){
        console.log(this);
        this.list.some((item,i)=>{
          if(item.id == id){
            this.list.splice(i,1)
            return true;
          }
        })
      }
    }
  })
</script>
</body>
</html>

del方法里,打印了一个this值。
f12开发者模式,默认显示的打印结果是
Vue {_uid: 0, _isVue: true, $options: {…}, _renderProxy: Proxy, _self: Vue, …} (未展开)

问题是,是否可能在未展开的状态下,搜索到 name:"宝马" 存在哪个地方?

现在我只能手动展开,找到,

Vue {_uid: 0, _isVue: true, $options: {…}, _renderProxy: Proxy, _self: Vue, …}
$attrs: (...)
$listeners: (...)
list: Array(1)
    0:
    id: 2
    name: "宝马"

有啥快捷键吗?
谢谢~~~

阅读 1.7k
1 个回答

装vue-devtools最方便。
不然就打印具体的this.list

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题