1、什么是插值表達(dá)式
雙大括號(hào),可以把vue數(shù)據(jù)變量直接顯示在標(biāo)簽內(nèi)
2、Vue變量聲明在哪里
data函數(shù)返回對(duì)象上,用key屬性聲明文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-607824.html
示例:文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-607824.html
<template>
<div id="app">
<h1>{{msg}}</h1>
<h2>{{obg.name}}</h2>
<h2>{{obg.age>5?"成年":"未成年"}}</h2>
</div>
</template>
<script>
export default {
data(){
return {
msg:"hello word",
obg:{
name: "zhangsan",
age:5
}
}
}
}
</script>
<style>
</style>
到了這里,關(guān)于vue指令-插值表達(dá)式的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!