Skip to content

Vue 基础

这是 Vue.js 的基础知识文档。

什么是 Vue.js?

Vue.js 是一个渐进式的 JavaScript 框架,用于构建用户界面。它的核心库只关注视图层,易于上手,并且可以与其他库或已有项目整合。

核心概念

  • 响应式数据绑定
  • 组件化开发
  • 指令系统
  • 虚拟 DOM

快速开始

html
<!DOCTYPE html>
<html>
<head>
  <title>Vue 示例</title>
  <script src="https://unpkg.com/vue@3"></script>
</head>
<body>
  <div id="app">
    {{ message }}
  </div>

  <script>
    const app = Vue.createApp({
      data() {
        return {
          message: 'Hello Vue!'
        }
      }
    })
    app.mount('#app')
  </script>
</body>
</html>