I create some dynamic components with a sample router, but when I change the currentView value to render the component, there are some warn message print like:
Data field "xxx" is already defined as a prop. Use prop default value instead.
obviously, I passed the parent data by props
with Vue.js 1.0.0-alpha.8
@ije having a code example would be helpful...
sorry, there are so many lines in my project, i just can paste the keypart of the dynamic component:
template look like this:
<component v-bind:is="currentPageEditView" v-bind:editing-page="editingPage" v-bind:editing-post="editingPost" v-bind:editing-content="editingContent"></component>
the parent vm config look like this:
{
template: 'blabla...',
data: function() {
return {
// other fields..
currentPageEditView: null,
editingPage: null,
editingPost: null,
editingContent: null
};
},
components: (function() {
var components = {};
utils.each(config.postPageComponents, function(component) {
// component preprocess
component.props = ['editingPage', 'editingPost', 'editingContent'];
components[component.id] = component;
})
return components;
})(),
methods: {
editPost: function(post) {
this.editingPost = post;
},
editPage: function(page) {
this.editingPage = page;
},
editContent: function(content) {
this.editingContent = content;
}
}
}
and the config.postPageComponents look like this:
var config = {
postPageComponents: [
{
template: 'blabla...',
id: 'component-id',
name: 'Name',
data: function(){},
method: {},
// blabla..
},
// more components define
]
};
sorry, I forget note that the parent vm is also a dynamic component...
@karevn thank you!
there is a screen shot of console warn messages.

@ije, it's "by design" behavior in new versions. If you need to have some default values for your props, just pass them in your prop config.
Declaring props is enough. No need to duplicate them in data.
Most helpful comment
Declaring props is enough. No need to duplicate them in
data.