vuejs app architecture for dynamic template with dynamic data and dynamic component type issue
See original GitHub issueSorry for posting ‘issue’ here. I have posted question on vue forum and stackoverflow but with no feedback. I am now developing an app with vuejs and the architecture is important from begining. Here is the link: http://forum.vuejs.org/topic/4604/how-to-address-component-with-dynamic-template-and-its-relative-data http://stackoverflow.com/questions/38342241/vuejs-better-way-to-address-component-with-dynamic-template-and-its-relative-dat I copy here for kind proposal. It is an architecture issue. I have following question/requirement, if anyone has good idea, please kindly post for discussion It is for the dynamically rendering for dynamical template and data use component The scenario is as following: 1.root vue instance fetch data from backend, say following data returned:
[
{
/* this section will be fed to a component */
type: 'FirstSub',
templatestr: '<div> <more-vue-customized-component itsdata="xxx"></more-vue-customized-component> </div>',
data: [
datafordynamicComponent: xxxx
]
},
...
{
/* this section will be fed to a component */
type: 'lastSub',
templatestr: '<p> <more-vue-customized-component itsdata="xxx"></more-vue-customized-component> </p>',
data: [
datafordynamicComponent: xxxx
]
}
- Which structure/architecture we can use to render as following composition using above data?
<root>
<FirstSub></FirstSub>
...
<lastSub></lastSub>
</root>
Issue Analytics
- State:
- Created 7 years ago
- Comments:13 (3 by maintainers)
Top GitHub Comments
Here is a related issue with feature request https://github.com/vuejs/vue/issues/2114.
I have wrote a
component-proxy
to resolve it which may do some help to you.About usage:
Does this solve your problem?