Upon opening the input screen, the input items are populated with session information. However, when jQuery switches display based on the input item's value, it refers to the initial value in the program rather than the session information. This suggests that the display switch occurs before setting the session data (the initial data is pre-set in the input item).
For instance, even if a session is established as seen in the source below, the screen still displays the category content as 1.
The concerning issue is the warning message displayed below:
[Vue warn]: Avoid adding reactive properties to a Vue instance or its root $ data at runtime-declare it upfront in the data option.
data: {
url: "",
category: 1,
errors: {},
},
created: function() {
let count_data = 0;
for (let key in old_data) {
if (old_data[key] != null && old_data[key] != "") {
count_data += 1;
}
}
if(count_data > 0) {
for(let key in old_data){
this.$set(this, key, old_data[key]);
}
}else{
let that = this;
axios.get('api/getSession')
.then(res => {
Object.entries(res.data).map(function(data){
that.$set(that, data[0], data[1]);
});
})
}
},