vuejs 使用动态模板及其相关数据处理组件的更好方法
vuejs better way to address component with dynamic template and its relative data?
我有以下问题/要求,如果有人有好主意,请发帖讨论它用于动态模板和数据使用组件的动态渲染场景如下:
根 vue 实例从后端获取数据,例如返回以下数据:
[
{
/* 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
]
}
]2. 我们可以使用哪种结构/架构来使用上述数据渲染为以下构图?
<root>
<FirstSub></FirstSub>
...
<lastSub></lastSub>
</root>
你能使用异步组件吗?
https://vuejs.org/guide/components.html#Async-Components
相关文章:
- 如何正确处理依赖ViewChild和Angular 2中可观察到的数据的组件上的更改检测
- React.js和丰富的数据网格组件或至少是hack [2015]
- EmberJS 应用程序中列表 + 详细信息 + 编辑视图的数据处理
- 如何在D3地图中进行时间数据处理
- JavaScript函数数据处理
- 画布已被跨源数据处理所污染
- 如何将全局状态数据处理到Redux中的深度嵌套组件中
- ReactJS处理组件更改
- React-Redux:如何用来自异步调用的数据填充组件'
- Angular-ui-router 0.3.2不能正确地处理组件
- D3js奇怪的日期和数据处理
- 创建可重用D3.js/jQuery数据属性组件或模块的可能性
- Ajax请求数据在组件之间传递
- 用它的数据处理数组中的每一项
- 如何从外部到内部动态地设置数据到组件
- 将嵌套json数据处理成数据连接
- 如何用redux处理组件状态
- 二进制数据处理和位与
- 使用Processing.js:我可以有多个画布只有一个数据处理源sketch.pde
- vuejs 使用动态模板及其相关数据处理组件的更好方法