-
Notifications
You must be signed in to change notification settings - Fork 46
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
vue2.0 点击上一页会报错 #7
Comments
确实存在这个问题。 |
我已经解决了 需要props双向绑定,父组件需要增加个回调函数来接上一页下一页的回调,感谢楼主的组件 |
@hotboys 可以把最新的组件发我吗,我想参考下。 |
@vipsimple 怎么发给你 git 我不咋会用= = |
@hotboys 你微信多少,我加你 |
这个问题就是因为在点击上一页下一页的时候子组件修改父组件的cur (当前页)导致的,我说一下我的解决办法吧, 楼主定义了一个btnClick方法,这个方法会在点击页码的时候生效,并将点击的页码传给父组件,我就重新定义一个btnClick1 方法, 对当前页减一,并传给父组件,替换掉原来直接cur-- 的操作. 然后 把上一页 方法改成 v-on:click="btnClick1(-1)" 下一页方法改成 v-on:click="btnClick1(1)" github issues 无法帖html代码, 会被转换成页面 真的糟心,一点也不好用 |
Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value. Prop being mutated: "cur"
这个得怎么解决 是双向绑定的问题吗
The text was updated successfully, but these errors were encountered: