File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 24
24
``` html
25
25
<!-- 字符串 -->
26
26
<router-link to =" home" >Home</router-link >
27
- <!-- renders to -->
27
+ <!-- 渲染结果 -->
28
28
<a href =" home" >Home</a >
29
29
30
30
<!-- 使用 v-bind 的 JS 表达式 -->
79
79
80
80
``` html
81
81
<router-link to =" /foo" tag =" li" >foo</router-link >
82
- <!-- renders as -->
82
+ <!-- 渲染结果 -->
83
83
<li >foo</li >
84
84
```
85
85
105
105
106
106
107
107
``` html
108
- <!-- this link will only be active at / -->
108
+ <!-- 这个链接只会在地址为 / 的时候被激活 -->
109
109
<router-link to =" /" exact >
110
110
```
111
111
112
112
查看更多关于激活链接类名的例子 [ 可运行] ( http://jsfiddle.net/fnlCtrl/dokbyypq/ ) .
113
113
114
- ### Applying Active Class to Outer Element
114
+ ### 将"激活时的CSS类名"应用在外层元素
115
115
116
- 有时候我们要让 "激活 class " 应用在外层元素,而不是 ` <a> ` 标签本身,那么可以用 ` <router-link> ` 渲染外层元素,包裹着内层的原生 ` <a> ` 标签:
116
+ 有时候我们要让 "激活时的CSS类名 " 应用在外层元素,而不是 ` <a> ` 标签本身,那么可以用 ` <router-link> ` 渲染外层元素,包裹着内层的原生 ` <a> ` 标签:
117
117
118
118
``` html
119
119
<router-link tag =" li" to =" /foo" >
120
120
<a >/foo</a >
121
121
</router-link >
122
122
```
123
123
124
- 在这种情况下,` <a> ` 将作为真实的链接(它会获得正确的 ` href ` 的),而 "激活 class " 则设置到外层的 ` <li> ` 。
124
+ 在这种情况下,` <a> ` 将作为真实的链接(它会获得正确的 ` href ` 的),而 "激活时的CSS类名 " 则设置到外层的 ` <li> ` 。
You can’t perform that action at this time.
0 commit comments