Vue.js is a progressive JavaScript framework for building user interfaces. Unlike monolithic frameworks, Vue is designed from the ground up to be incrementally adoptable — you can use it to sprinkle interactivity on a page, or power a full Single Page Application.
Vue 3 (released 2020) introduced the Composition API, improved TypeScript support, and the script setup syntax. All new projects should use Vue 3.
<!DOCTYPE html>
<html>
<head>
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
</head>
<body>
<div id="app">
<h1>{{ message }}</h1>
<button @click="count++">Clicked {{ count }} times</button>
</div>
<script>
const { createApp, ref } = Vue;
createApp({
setup() {
const message = ref('Hello, Vue 3!');
const count = ref(0);
return { message, count };
}
}).mount('#app');
</script>
</body>
</html>