M
Size: a a a
M
EN
AV
this.$router.replace({
query: { ...this.$route.query, query: yourValue },
});
mockState={
offer: {
vsu: 38000,
options: {
cycleTheft: {
check: false,
amount: 1,
}
}
}
mockStateAmount200={
...mockState,
offer: {
...mockState.offer,
options: {
...mockState.offer.options,
cycleTheft:{
...mockState.offer.options.cycleTheft,
amount : 200 // наконец-то!
}
}
}
}
IK
mockState={
offer: {
vsu: 38000,
options: {
cycleTheft: {
check: false,
amount: 1,
}
}
}
mockStateAmount200={
...mockState,
offer: {
...mockState.offer,
options: {
...mockState.offer.options,
cycleTheft:{
...mockState.offer.options.cycleTheft,
amount : 200 // наконец-то!
}
}
}
}
IK
AV
IK
const mockState200 = produce(mockState, draftState => {
draftState.offer.options.cycleTheft.amount = 200;
});
IK
AV
type DeepWriteable<T> = { -readonly [P in keyof T]: DeepWriteable<T[P]> };
mockStateAmount200=mockState as DeepWriteable<Something>;
mockStateAmount200.offer.options.cycleTheft.amount=200;
AV
const mockState200 = produce(mockState, draftState => {
draftState.offer.options.cycleTheft.amount = 200;
});
IK
AV
type DeepWriteable<T> = { -readonly [P in keyof T]: DeepWriteable<T[P]> };
mockStateAmount200=mockState as DeepWriteable<Something>;
mockStateAmount200.offer.options.cycleTheft.amount=200;
IK
IK
AV
IK
IK
AV
AV
function deepCopy<T extends object>(source: T): any {
return JSON.parse(JSON.stringify(source))
}
AV
mock200=deepCopy(mockState)