Vue3.0安装以及插件推荐

    科技2024-05-14  70

    确保电脑中安装了 node.js 服务端运行环境,node 版本查询终端输入 node -v 指令

    一、配置 Vue3.0 开发环境

    // 全局安装或升级 npm install -g @vue/cli # OR yarn global add @vue/cli // 使用 vue 创建项目 vue create my-project # OR // 使用图形化界面创建项目 vue ui

    项目创建步骤

    Please pick a preset -- 选择 Manually select featuresCheck the features needed for your project -- 默认选项加上 TypeScript注意:点空格是选择,点回车是进入下一步Choose a version of Vue.js that you want to start the project with -- 选择 3.x (Preview)Use class-style component syntax -- 输入 n,回车Use Babel alongside TypeScript -- 输入n,回车Pick a linter / formatter config -- 直接回车Pick additional lint features -- 直接回车Where do you prefer placing config for Babel, ESLint, etc.? -- 直接回车Save this as a preset for future projects? -- 输入n,回车

    二、插件推荐

    Eslint 插件 如果 eslint 不生效,在根目录创建 .vscode 文件夹,在文件夹中创建 settings.json 文件,输入以下内容

    // settings.json { "eslint.validate": ["typescript"] }

    vetur 插件

    参考文档:http://docs.vikingship.xyz/vue3-basic.html

    Processed: 0.013, SQL: 8