function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

How to pass field API names in LWC from design property

Hi All ,
Please help me to fix below issue ,
I'm creating a reusable component in lWC with using recordeditfrom and i'm passing field api name and object from design property .  it is working fine with object api name when passing from desing property but when i passing field api name is not working , please find below my code and where i did mistake ?

Metadata.xml :
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="" fqn="MyComponent">


        <targetConfig targets="lightning__RecordPage">
             <property name="Mode" type="String" label="Mode" datasource="Read Only, View ,Edit"/>
            <property name="objectName" type="String" label="objectName" />
            <property name="fieldnames" type="String" label="fieldnames" />

        <lightning-record-edit-form object-api-name={objectName}>
            <template for:each={fieldnames} for:item="item" >
                            <div key={item} >
                                <lightning-input-field field-name= {item}> </lightning-input-field>
            <lightning-button class="slds-m-top_small" type="submit" label="Create new" >
js controller :

import { LightningElement, api } from 'lwc';
export default class MyComponent extends LightningElement {
    @api recordId;
    @api objectName ;
    @api fieldnames ;

Thanks in Advance