javascript - Why can only fixed values ​​be passed in vue router-link to?
滿天的星座
滿天的星座 2017-07-06 10:34:47
0
3
879
 <router-link to="'/intro/'+item.id">
                        <p class="gradual"><span>{{item.name}}</span><br>{{item.name}}</p>
                        <img class="store_img" :src="item.pic">
                    </router-link>

Why the connection is written like this #/'/intro/' item.id
How to transfer dynamic values

滿天的星座
滿天的星座

reply all(3)
Peter_Zhu

To be dynamic, the attributes do not add : (abbreviation of v-bind:), it is a static attribute. Whatever is passed is what it is. Otherwise, the expression

can be passed in
:to="'/intro/'+item.id"

OR

v-bind:to="'/intro/'+item.id"
滿天的星座

to ===> :to

刘奇

to is the element attribute you added. :to is an attribute that Vue can recognize and parse, and the content after :to will be executed as an expression.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!