v-bind bind động một thuộc tính HTML (hoặc prop của component) với một biểu thức JavaScript, để thuộc tính cập nhật reactive khi dữ liệu thay đổi. Viết tắt của nó chỉ là :.
<script setup>
import { ref } from "vue";
const imageUrl = ref("/photo.jpg");
const isDisabled = ref(true);
const id = ref("main");
</script>
<template>
<img v-bind:src="imageUrl" /> <!-- cú pháp đầy đủ -->
<img :src="imageUrl" /> <!-- viết tắt (idiomatic) -->
<button :disabled="isDisabled">Save</button>
<div :id="id" :data-index="5">...</div>
</template>
