Vue's functional components are small and flexible enough to be declared inside of .vue file next to the main component. This allows you to mix jsx and Vue's templates so you have complete control over how to render your content.

Robot.vue:

<script>
export default {
functional: true,
render: (h, {props, data}) => {
return props.names.map(
name => `https://robohash.org/${name}?set=set${props.num}`
).map(
url => <div><img src={url} alt="" /></div>
);
}
}
</script>

Using:

<template>
<section slot="content" class="flex flex-row flex-no-wrap">
<Robot :names="names" :num="2"></Robot>
</section>
</template> <script>
@Component({
components: {
Layout,
Settings,
Robot
}
})
export default class HelloWorld extends Vue {
@Prop({
default: ["mindy", "john", "kim", "joel", "ben"]
}) names
}
</script>

最新文章

  1. 前台获取Dropdownlist选中的text
  2. docker 数据卷 权限
  3. java入门必备单词
  4. C# vs C++ Performance
  5. IBatis.Net系列-多参数的SQL语句的配置
  6. Oracle 安装 检查操作系统版本 必须是 5.0 5.1 的解决办法
  7. :app:transformResourcesWithMergeJavaResForDebug FAILED
  8. 交叉编译和使用HTOP
  9. Keil 二进制数输入宏
  10. JS页面打开方式丶对话框及页面跳转方式
  11. openstack中使用linux_bridge实现vxlan网络
  12. bzoj 2724 蒲公英 分块
  13. asp.net core 将配置文件配置迁移到数据库(一)
  14. 高性能消息队列NSQ
  15. Java实现简单计算器、抽票程序
  16. rrnDB数据库简介-16S基因多拷贝数的证据
  17. GoLand(二)语言结构和基础语法
  18. 怎么查看在centos中创建的用户组
  19. CSS鼠标手势
  20. 使用RStudio学习一个简单神经网络

热门文章

  1. Sql2008调试问题
  2. 自定义样式 dialog
  3. Pro ASP.NET Core MVC 第6版 第一章
  4. scroll的应用
  5. 对比hive和mysql查询汇总
  6. FusionCharts之我用
  7. QT 杂记
  8. Java基础(八)--String(源码)、StringBuffer、StringBuilder
  9. 08Webpage Form
  10. idea之查看类的上下级继承关系