Can't jump be written directly in the html code in Vue? Will report an error Cannot read property'$router' of null

<li class="col25" @click="this.$router.push({name:"RentList"})"><img width="32px" height="32px" src="../assets/images/home1.png"/><span style="display:block;"></span></li>

do I have to write the js code in method?

Apr.26,2022

this points to
directly @ click= "$router.push ({....})"


1. When rendering the template, there is no $router object. vue provides < router-link to= "/ foo" > Go to Foo < / router-link > for template routing.


just remove the this

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