When I attempt the following:
<div class="panel panel-default" v-if="socialiteLogins !== null">
The panel remains visible. Checking socialiteLogins === null
or with == both indicate that the object is not null, even though it actually is. When dumped on the page, it returns [] as the result - an empty JSON object. Thus, trying this results in the same issue:
<div class="panel panel-default" v-if="socialiteLogins.length !== 0">
The panel still does not hide and triggers the error message:
Cannot read property 'length' of null
However, if I use the following condition:
<div class="panel panel-default" v-if="socialiteLogins !== null && socialiteLogins.length !== 0">
It successfully hides the panel without any warnings upon initial load. Yet, updating the socialiteLogins variable later may trigger the length warning when it reverts back to an empty JSON object. Any thoughts on why this occurs?
Edit:
Expanding on this... if I try:
<div class="panel panel-default" v-show="socialiteLogins">
The panel appears on initial load even when there are no records present. However, removing them after the page loads correctly hides the panel. It seems the only issue lies during the initial loading phase, where it fails to detect the absence of records.