📜  lwc 中的有线服务适配器 - 任何代码示例

📅  最后修改于: 2022-03-11 14:59:48.227000             🧑  作者: Mango

代码示例1
import { LightningElement, api, wire } from 'lwc';
import { getRecord } from 'lightning/uiRecordApi';

export default class Record extends LightningElement {
    @api recordId;

    @wire(getRecord, { recordId: '$recordId', fields: ['Opportunity.Name'] })
    record;
}