HTML在Aura组件中显示

问题描述

<aura:component implements="force:appHostable,lightning:isUrlAddressable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningquickaction" controller="AccountController" access="global" >

    <aura:attribute type="campaign[]" name="acctList"/>
    <aura:attribute name="mycolumns" type="List"/>
      
    <aura:handler name="init" value="{!this}" action="{!c.fetchAcc}"/>
      
    <lightning:datatable data="{! v.acctList }"
                         columns="{! v.mycolumns }"
                         keyField="id"
                         hideCheckBoxColumn="true"/>
      
</aura:component>

解决方法

您可以使用

<aura:unescapedHtml value=""/>