Should vue get back-end data in created or mounted method?

should vue acquire backend data in created or mounted method

Mar.22,2021

depends. Generally, you can put it in created. In this way, you can send a request to obtain data as soon as possible. If you have to rely on dom, put it in mounted () {this.$nextTick (() = > {/ * code * /})}


I prefer to put it in mounted, because sometimes I have to combine ref operation


if there is more data requested asynchronously. Will it cause the page to be rendered. The data didn't bind successfully.
is there a resolve on a route like angular

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-1b37910-2b8ee.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-1b37910-2b8ee.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?