美文网首页
新建一个vue3+ts项目

新建一个vue3+ts项目

作者: 月下小酌_dbd5 | 来源:发表于2022-06-01 14:39 被阅读0次

方法一:vue 指令

    1. vue指令(注意:项目名不能有大写字母,否则有报错)
vue create ol-vue3(项目名)
    1. 选择 Manually select features (手动选择功能)


      image.png
    1. 选择项目所需要的特性


      image.png
    1. 配置项目特性


      选择项目版本
//是否使用类样式组件语法?
? Use class-style component syntax? (y/N) y
// 在TypeScript旁边使用Babel(现代模式、自动检测多边形填充、传输JSX所需)?(是/否)
? Use Babel alongside TypeScript (required for modern mode, auto-detected polyfills, transpiling JSX)? (Y/n) y
// 路由器是否使用历史记录模式?(需要为生产中的索引回退进行正确的服务器设置)(是/否)
? Use history mode for router? (Requires proper server setup for index fallback in production) (Y/n)  n
? Pick a CSS pre-processor (PostCSS, Autoprefixer and CSS Modules are supported by default): 
  Sass/SCSS (with dart-sass)
  Sass/SCSS (with node-sass)
> Less
  Stylus
// 您希望将Babel、ESLint等的配置放在哪里。?
? Where do you prefer placing config for Babel, ESLint, etc.? 
  In dedicated config files//在专用配置文件中
> In package.json//在package.json文件
//是否将此保存为将来项目的预设?(是/否)
? Save this as a preset for future projects? (y/N) n
    1. cd到项目目录下


      image.png
cd ol-vue3
    1. 运行项目
npm run serve
image.png
image.png

方法二:使用 vue ui 命令来搭建

  • 使用 vue ui 命令后,会自动打开一个Vue 项目管理器网页,然后在手动搭建项目就行了
vue ui

相关文章

网友评论

      本文标题:新建一个vue3+ts项目

      本文链接:https://www.haomeiwen.com/subject/vxexmrtx.html