LWC: 将VF页面显示在LWC中

可以将VF页面以iframe的形式使其显示在LWC中,以达到开发需求。
示例如下:
 
HTML:
<template>
  <div class="slds-box slds-theme--default">
    <iframe src={vfPageURL} height="100%" width="150px"></iframe>
  </div>
</template>

JavaScript:
import { LightningElement,api } from 'lwc';
export default class SampleRecordPage extends LightningElement {
  siteURL;
  @api recordId;
  connectedCallback() {
    this.vfPageURL = '/apex/TestVF?recordId=' + this.recordId;
  }
}
原文地址:https://www.cnblogs.com/clsriz/p/15607810.html