Article From:
<!DOCTYPE html>
<html lang="en">
    <meta charset="UTF-8">
    <title>VueMiddle set method & lt; / Title & gt;Script src=". / vue. js" & gt; & lt; / script & gt;Lt; / head & gt;< body>Div id= "app" & gt;<!--< div v-for="(item,key,index) of userInfo">-->
        <!--</div>               &lt;!&ndash;Loop objects & amp; ndash; & amp; gt; - - gt;< div v-for="(item,index) of userInfo1">
        </div>               <!--Loop arrays - gt;< /div>Script & gt;var vm = new Vue({
                // userInfo:{
                //     name:'alex',
                //     age:'27',
                //     gender:'male',
                //     salary:'secret'
                // }


This is when the data can be directly changed and rendered on the page without changing the address reference.Vm. $set (vm. userInfo,'address','beijing') The same effect can also be achieved.For lists, both of the above set usage can change data rendering on a Web page.Vue. set (vm. userInfo,1,5)



Link of this Article: Basic usage of set in Vue

Leave a Reply

Your email address will not be published. Required fields are marked *