SoFunction
Updated on 2025-04-13

Solutions for Vue data echo form cannot be edited

Vue data echo form cannot be edited

In the project, sometimes it is possible to encounter the form that cannot be edited when data echo is performed.

handleCurrency(item, statusList) {
        ( = statusList),
        ( = ),
        ( =  == "null" ? "" : ),
        ( = ),
        ( = )
    }

Later, in the echo method, I added:

 = ((item))

Then it will be used normally.

Vue component data cannot be cleared after echoing

This situation generally occurs when the parent component passes the value to the child component. We receive the value of the child component through props and echo it in the child component. After the echo is completed, it is cleared and found that it cannot be cleared.

At this time, we must remember that the value of the parent component cannot be changed in the child component.

There are two ways to clear this value

1: A more violent method. We will copy a copy of the value obtained from the parent component and use the new data in the child component, so that the value can be cleared.

created() {
     = (())
},

2: When the child component changes, tell the parent component to make changes through a method, so that the value passed to the child component will change accordingly. This involves parent-child component communication.

Communication between father and son: (father passed on to son)

Parent component:

<operate
    :isOperat="flag"
    :formInline="dataadd"s"
></operate>

Subcomponents:

props: {
    isOperat: String,
    formInline: Object,
}

(Son passed on to father)

Subcomponents:

&lt;input @click="sendMsg" type="button" value="Passing values ​​to parent component"&gt;

method:

sendMsg(){
    //func: is a function specified by the parent component to pass data binding: the data passed to the parent component by the child component.    this.$emit('func',)
} 

Parent component:

<child @func="getMsgFormSon"></child>

method:

getMsgFormSon(data){
     = data
    ()
}

The above is personal experience. I hope you can give you a reference and I hope you can support me more.