Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
2697 Vizualizări

I have 2 Component Child like this

Js:

export class QT3Form extends Component {
static props = {
handleSubmit: {type: Function}
}
static template = "website_qt3.form"
}

export class QT3Input extends Component {
static props = {
title: {type: String},
type: {type: String},
id: {type: String},
model: {type: String},
required: {type: Boolean}
}
static template = "website_qt3.input"
}

xml:




Submit










And this is the parent component when I use it

JS:

class Parent extends Component {
    static components = {QT3Form, QT3Input}

    setup() {
        super.setup();
        this.state = useState({
            form: {
                name: '',
                sex: 'male',
                age: 0,
                files: []
            },
        })
    }

    handleSubmit = async (e) => {
        e.preventDefault()
       ...something code
    }
}

xml:



As of now, I can only pass the handleSubmit prop to the Form component, but the Input component does not receive props other than the model (only model props are passed to the Input and title, type,... are not received).

What is this error and how to fix it, thanks all

Imagine profil
Abandonează
Autor Cel mai bun răspuns


.

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
1
aug. 24
2681
2
mai 25
24437
1
iun. 24
3285
2
mai 24
1803
2
apr. 24
5217