How does Vue force the refresh of the V-for list?

<li :class= "isnewList()?"active" : """ v-for="(list, index) in shoppinglists" :key="list.id"  role="presentation">

methods: {
  test(){
    this.$forceUpdate();//
  }


addnewListnewListactive class
listactive

newListactive    

clipboard.png

(bootstrap nav component implements mouse click to generate active class)

Mar.07,2021

$forceUpdate () forces the Vue instance to render again. Note that it affects only the instance itself and the sub-components that insert the contents of the slot, not all the sub-components.
you can think differently. You bind a click event to each li, pass in index, assign index to a variable such as curr in the method, and then use on li: class= "index = = curr?'active':'"
so that you can add class to the clicked li


.

solution: use DOM to operate `removeActive () {

    let nav = document.querySelector(".nav").querySelector(".active"); //active
    let content = document.querySelector(".tab-content").querySelector(".active");//active
    if(nav!==null)
    nav.className = '';
    if (content!==null)
    content.className = 'tab-pane';
  },`
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-1bd19a1-2fad6.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-1bd19a1-2fad6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?