Internet Engineering
Introduction · Reactivity · Template Syntax · Components · Tooling
Fall 2026 ·
Amirkabir University of Technology
@1995parham
A progressive framework for building user interfaces.
Originally presented by Pooya and Parsa. The original slides are also available as a PowerPoint file.
getElementById and no manual update
import { createApp, ref } from "vue";
createApp({
setup() {
const count = ref(0);
return { count };
},
}).mount("#app");
<div id="app">{{ count }}</div>
ref wraps a single value, read and written
through .value in JavaScriptreactive makes a whole object reactive,
used directly
const count = ref(0);
count.value++;
const student = reactive({ name: "Parham", id: "9231058" });
student.name = "Ali";
import { computed, ref } from "vue";
const first = ref("Parham");
const last = ref("Alvani");
const fullName = computed(() => `${first.value} ${last.value}`);
{{ }} puts a value in the text of the
pagev-bind, shortened to
:, puts it in an attribute
<p>{{ message }}</p>
<img :src="imageUrl" :alt="message" />
<p v-if="students.length === 0">No students yet</p>
<p v-else>{{ students.length }} students</p>
<ul>
<li v-for="student in students" :key="student.id">
{{ student.name }}
</li>
</ul>
:key tells Vue which item is which, so it
can reuse the DOM instead of rebuilding the listv-if removes the element, v-show only hides it
with CSSv-on, shortened to
@, listens for an eventv-model binds an input in
both directions
<button @click="count++">{{ count }}</button>
<input v-model="name" placeholder="your name" />
<p>Hello {{ name }}</p>
Template, logic, and style for one component live in one
.vue file.
<script setup>
import { ref } from "vue";
const props = defineProps({ title: String });
const count = ref(0);
</script>
<template>
<h2>{{ props.title }}</h2>
<button @click="count++">clicked {{ count }} times</button>
</template>
<style scoped>
button { color: #ff9100; }
</style>
scoped styles apply to this component only, so class names
cannot leak
const emit = defineEmits(["selected"]);
emit("selected", student.id);
npm create vue@latest
