The first time the page is loaded in vue, there is no value in the data object. It will be fine after refreshing.

uses the background management system made by vue. When entering for the first time, the page data is not loaded. An error is reported: Cannot read property "realname" of undefined
. After refreshing, the value will come out
before the page is refreshed.

this this.user is the value used

.
Mar.12,2021
Try

in created.


add a "user" to the div


this should be the wrong initial value of the user variable you gave.
get the background data only after your api is mounted, and one of the data objects returned in the background is realname,. When you are in mounted, while the data is being acquired, the template has already been initialized and rendered, so the template needs the realname attribute value in your user. If there is any in your initialization value, you should not report an error


.

get the data of asynchronously, right? Add a user to the div corresponding to "basic data" ,

your getSysUser method looks a little strange. Is it asynchronous? If it is Promise , then less await and async

are written.
   
get the returned value in the middle and assign it. Only when you enter this page for the first time will no data appear. Just refresh it

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b39b12-2c1cb.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b39b12-2c1cb.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?