卖坚果的怪叔叔 卖坚果的怪叔叔
  • 首页
  • 技术
  • 生活
  • 记录
  • 朋友
  • 常用代码
  • 关于
首页 › 技术 › Element render函数中使用map插入多条数据!

Element render函数中使用map插入多条数据!

坚果大叔
2021-10-21 15:06:13技术阅读数 738

在iview中经常频繁的使用render函数来进行表格的内容动态显示。其插入的方法如下:

{
  title: "参加人员名单",
  align: "left",
  minWidth: 180,
  render: (h, { row }) => {
    return h("div", [
      // 直接map输出即可
      data.map(item => {
        h("p", item.name);
      })
    ]);
  }
}

在Element中render函数的插入方法如下:

const h = this.$createElement;
let messageData = [];

messageData.push(h("span", null, "遍历列表之前的数据"));

// 通过 map 生成的数据
data.map(item => {
    messageData.push(h("span", item.name)
});

messageData.push(h("span", null, "遍历列表之后的数据"));

message: h("div", null, messageData)
问题记录
赞赏 赞(0)
本文系作者 @坚果大叔 原创发布在 卖坚果的怪叔叔。未经许可,禁止转载。
JS批量下载网页中的图片!
上一篇
十月末
下一篇

评论已关闭。

今日天气
摸鱼日历
摸鱼人日历
近期文章
  • 猫🐱
  • Input 空格问题
  • Sort函数小Tips😁😃❤️😒😭😩😳
  • 🌎🌎🌎🌎🌎🌎🌎🌎🌎🌎🌎🌎
  • element-ui中的Select选择器中remote-method方法带自定义参数
归档
  • 2022年6月
  • 2022年5月
  • 2022年4月
  • 2022年3月
  • 2022年2月
  • 2022年1月
  • 2021年12月
  • 2021年11月
  • 2021年10月
  • 2021年9月
  • 2021年8月
  • 2021年7月
  • 2021年5月
  • 2021年4月
  • 2021年2月
  • 2021年1月
  • 2020年12月
  • 2020年11月
  • 2020年10月
  • 2020年9月
  • 2020年8月
  • 2020年7月
  • 2020年6月
  • 2020年5月
  • 2020年4月
  • 2020年3月
  • 2020年2月
  • 2020年1月
  • 2019年12月
  • 2019年11月
  • 2019年10月
  • 2019年9月
  • 2019年8月
  • 2019年7月
  • 2019年6月
  • 2019年5月
  • 2019年4月
  • 2019年3月
  • 2019年2月
  • 2019年1月
  • 2018年12月
  • 2018年11月
  • 2018年10月
  • 2018年9月
  • 2018年8月
  • 2018年7月
  • 2018年6月
  • 2018年5月
  • 2018年3月
  • 2018年2月
  • 2017年12月
  • 2017年11月
  • 2017年9月
Input 空格问题
2022-06-22 10:52:44
24 0 0
Sort函数小Tips😁😃❤️😒😭😩😳
2022-06-20 15:09:29
26 0 0
element-ui中的Select选择器中remote-method方法带自定义参数
2022-05-27 16:13:19
123 2 1
CSS之GAP属性
2022-05-25 19:28:05
98 2 2
  • 0
博主

一枚佛系前端开发,会一丢丢摄影,喜欢折腾,爱好美食。分享点前端技巧、笔记以及各种有趣的APP和资源教程♥♥

友链
Lieme
公众号
西豆 崔欣 执行上下文 卖坚果的怪叔叔 集赞助手
Copyright © 2017-2022 卖坚果的怪叔叔

苏ICP备18048410号-2
  • 首页
  • 技术
  • 生活
  • 记录
  • 朋友
  • 常用代码
  • 关于
# WordPress # # CSS #
坚果大叔
198
文章
47
评论
116
喜欢