Using the v-pre
directive to prevent compilation of a <p>
element.
<img v-bind:src="imgUrl[imgIndex]">
<p v-pre>Img src: '{{ imgUrl[imgIndex] }}' <strong>(Not compiled)</strong></p>
<p>Img src: '{{ imgUrl[imgIndex] }}' <strong>(Compiled version)</strong></p>
<button v-on:click="changeImg">Change image</button>
Run Example »
The v-pre
directive skips compilation for this element, and all of its child elements.
The v-pre
directive can be used to display raw Vue code, like curly braces {{ }}
.
Vue Tutorial: Vue v-bind Directive
Vue Tutorial: Vue v-on Directive
Vue Tutorial: Vue Methods
HTML Reference: HTML <pre> Tag
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!