Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

https://github.com/liangxiaojuan/vue-todos/blob/master/src/mock/mock.js#L64 #17

Open
laughitoff opened this issue Dec 20, 2018 · 1 comment

Comments

@laughitoff
Copy link

Originally posted by @thoth-hank in #16 (comment)

@laughitoff
Copy link
Author

修改后 得到一个新error
Uncaught (in promise) TypeError: Cannot read property 'id' of undefined

methods: {
init() {
// 获取到 $route下params下的id,即我们在menus.vue组件处传入的数据。
const ID = this.$route.params.id;
getTodo({ id: ID }).then(res => { //错误在这一行

    let { id, title, count, isDelete, locked, record
    } = res.data.todo;
    // 请求成功,拿到res.data.todo;在将record 赋值到代办单项列表,其它数据赋值到todo对象
    this.items = record;
    this.todo = {
      id: id,
      title: title,
      count: count,
      locked: locked,
      isDelete: isDelete
    };
  });
},

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant