When i edit a dict in an array which has been cloned from another dict, all the duplicated dictionary values also changes

110 views Asked by At

when I edit a dict in a array which has been cloned from another dict,the value of the other cloned dictionaries also changes. Is there a way where i can change only the specified dictionary value??

 <template v-for="stage in clonedstages">
                        <p v-text="stage.name" @click="stagedisplay=true" > </p>
                        <stage header="Stage Edit" :visible.sync="stagedisplay" :modal="true">
                            <div>
                              <div class="form-group">
                            <label for="stagename">Stage name </label>
                            <input type="text" class="form-control" id="stagename" v-model="[index]clonedstages.name">
                              </div>
                            </div>
                            <button class="btn btn-secondary" @click="stagedisplay=false">Done</button>
                        </stage>
                          </template>
<div class="col-sm">
                          <button class="btn-sm btn-primary" @click="Gd">GD</button>
`
interview: {
      stage_type : 1,
          description : "something",
          name : "Interview"
      },

clonedstages: [],

this is the dict,

Interview(){
      vue_create.clonedstages.push(vue_create.interview);
  },

this is the method.

I am new to this.

0

There are 0 answers