const initFromData =
{
code: '', // ----------------string
name: '', // ---------------string
working_days: [], // ---------------array
shift_period: [] // ---------------array contains multiple array
};
export default {
data() {
return {
regForm: Object.assign({}, initFromData)
}
}
}
Changes of regForm. shift_period
is also affects initFromData.shift_period
. But other properties has no issue. Why? How to prevent this?