<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<!-- 1. 导入 vue 脚本文件 -->
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
</head>
<body>
<!-- 2. 声明 vue 控制 DOM 区域 -->
<div id="app">{{ message }}</div>
<script>
// 3. 创建 vue 实例对象
const {
createApp,
ref
} = Vue
createApp({
setup() {
const message = ref('Hello vue!')
return {
message
}
}
}).mount('#app')
</script>
</body>
</html>
https://cn.vuejs.org/guide/quick-start.html#creating-a-vue-application