vue.js - Remove reference from object javascript -
i searching solution can replace object content other in array of objects.
the thing is, don't know function pass, can't pass values inside keys directly, reference won't copied, there way can assign value directly without passing reference? know objects pass references , not values, there way that?
i tried 2 ways:
state.document["atributes"].splice(state.document["atributes"][state.currentindex],1,section); and
state.document["atributes"][state.currentindex] = section where state.document["atributs"] array, , state.currentindex index want replace element inside array.
what happens @ moment object can table paragraph etc.
if objects same replaces content :/
any this? thank you
if you're modify in currentindex, try
vue.set(state.document["atributes"], state.currentindex, section) reference: vue documentation
Comments
Post a Comment