Element UI表单中数据是字符串并含有多个内容并存时,如何进行换行展示
发布日期:2021-05-10 07:40:15 浏览次数:12 分类:精选文章

本文共 2590 字,大约阅读时间需要 8 分钟。

���Element UI���������������������������������������������������������������������������������������������������������������������������������������

������������������������������������������������

������������������������������������������������������������������������������������������

���������������

  • ������v-for���������������������������������
  • :key="index"������������������������������������������
  • ���������������������������������������������

������������������������������������������������������������������������������

������������������v-html������

������������������������������������������ HTML ���������������������������������������

���������������

  • ������v-html������������������������������������ HTML ������
  • ������������������������������������������������

���������������

  • ��������������������������������������������������� (XSS)
  • ������������������������������������������������������������������������������
  • ���������������������������������������������
  • ������������������������

    ���������������������������������������������������������������������������replace���������split������������������������������������������������������

    search () {
    this.listLoading = true
    userApi.hot(this.queryParam).then(data => {
    const re = data.response
    this.tableData = re.list
    this.total = re.total
    this.queryParam.pageIndex = re.pageNum
    this.listLoading = false
    // ������������������������������������
    // this.tableData.forEach((value, index) => {
    // try {
    // value.recallGoodsNums = value.recallGoodsNums.split(',')
    // } catch (err) {
    // console.log('err', err)
    // }
    // })
    // ������������������v-html
    this.tableData.map((value, index) => {
    if (value.recallGoodsNums != null) {
    value.recallGoodsNums = value.recallGoodsNums.replace(',', '
    ')
    // ��������� split ������������������������
    // value.recallGoodsNums = value.recallGoodsNums.split(',')
    // value.recallGoodsNums = value.recallGoodsNums.split('').join(',')
    }
    })
    })
    }

    ������������

    ���������������������������������

  • ���������������������
  • ������������������������������HTML ���������
  • ������������������������������������������������������
  • ������������

  • ������������������ recallGoodsNums ���������������������������������������������������������������
  • ������������������������������������������������������������������������������������
  • ������������������������������������������������������������������������������

    上一篇:vue切换导航栏1
    下一篇:导出 下载excel 方案(点击下载,下载一个excel模板)

    发表评论

    最新留言

    关注你微信了!
    [***.104.42.241]2025年04月19日 13时48分58秒