ရိုးရိုးလေး ရှင်းပြမယ်
Template ထဲတွင် {{ value }} က text interpolation ဖြစ်သည်။ HTML attribute များကို reactive value နှင့်ချိတ်ရန် v-bind သို့မဟုတ် အတိုကောက် : ကိုသုံးသည်။ User input ကို v-html ဖြင့်တိုက်ရိုက် render မလုပ်သင့်ပါ။
vue
<script setup>
const profile = {
name: 'Su Su',
avatar: '/avatar.png',
active: true
}
</script>
<template>
<h2>{{ profile.name }}</h2>
<img :src="profile.avatar" :alt="profile.name">
<p :class="{ online: profile.active }">Online</p>
</template>You should see
Su Su
[avatar image]
Onlineလက်တွေ့စမ်းကြည့်ရန်
Product object တစ်ခုဖန်တီးပြီး title, price နှင့် image src ကို template တွင်ပြပါ။
Template Syntax — Vue.js