For AI agents: the complete documentation index is available at https://nhanbe.id.vn/llms.txt, the full documentation bundle is available at https://nhanbe.id.vn/llms-full.txt, and this page is available as Markdown at https://nhanbe.id.vn/frontend/vue2.7/installation.md.

create vite Vue cli Vue 2.7 - create vue project Vite main.js - package.json - install

Installation

create vite

Vue cli

Vue 2.7

npm install -g @vue/cli
  • create vue project
vue create vue2-learning

Vite

 npm create vite@latest my-app -- --template vue

main.js

import Vue from 'vue'

import App from './App.vue'

new Vue({
    render: h => h(App),
}).$mount("#app")
  • package.json
{
  "name": "my-app",
  "private": true,
  "version": "0.0.0",
  "type": "module",
  "scripts": {
    "dev": "vite",
    "build": "vite build",
    "preview": "vite preview"
  },
  "dependencies": {
    "vue": "^2.7.16"
  },
  "devDependencies": {
    "@vitejs/plugin-vue2": "^2.2.6",
    "vite": "^4.5.0"
  }
}
import Vue from 'vue'
import App from './App.vue'

new Vue({
  render: h => h(App),
}).$mount('#app')
  • install
npm install --legacy-peer-deps