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
1.0.18
parent component
<template> <div id="app"> <img class="logo" src="./assets/logo.png"> <hello :list="list"></hello> </div> </template> <script> import Hello from './components/Hello' export default { data () { return { list: [{ name: 'test-example1', id: 1 }, { name: 'test-example2', id: 2 }, { name: 'test-example3', id: 3 }] } }, components: { Hello } } </script>
<template> <div class="hello"> <h1>{{ msg }}</h1> <li v-for="item in list" track-by="$index">{{item.name}}</li> <button @click="clickHandle">push item</button> </div> </template> <script> var mockData = { name: 'test', id: 'test', test: false } export default { props: ['list'], data () { return { msg: 'Hello World!' } }, created () { // mock code this.list = this.list.map(item => { return { name: item.name, id: item.id, test: false } }) }, methods: { clickHandle () { this.list.push(mockData) } } } </script>
It can work in version 1.0.17 But in the 1.0.18 version, I click on the button .data is changed, but the list is no rendering
I do not see the changes for this feature for read the relase note I do not know if I missed something, hoping to get answers
The text was updated successfully, but these errors were encountered:
vuejs/vue@a6b9454
This is fixed, however, mutating a passed down prop is not a recommended practice - it's best to treat props as immutable values and let its original owners do the mutation.
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Vue.js version
1.0.18
parent component
It can work in version 1.0.17 But in the 1.0.18 version, I click on the button .data is changed, but the list is no rendering
I do not see the changes for this feature for read the relase note
I do not know if I missed something, hoping to get answers
The text was updated successfully, but these errors were encountered: