|
|
@@ -16,3 +16,31 @@ If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has a
|
|
|
1. Run `Extensions: Show Built-in Extensions` from VSCode's command palette
|
|
|
2. Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)`
|
|
|
2. Reload the VSCode window by running `Developer: Reload Window` from the command palette.
|
|
|
+
|
|
|
+
|
|
|
+## 记录
|
|
|
+
|
|
|
+-------------------
|
|
|
+
|
|
|
+1. 新建项目 ``npm create vite@latest vue-vite-ts -- --template vue-ts``。
|
|
|
+2. 加载依赖 ``npm i``,启动服务``npm run dev``。
|
|
|
+3. 修改``vite.config.ts`` 中的配置,``defineConfig.server``新增配置。
|
|
|
+ > {
|
|
|
+ > hmr:true,
|
|
|
+ > port: 9074,
|
|
|
+ > open: true,
|
|
|
+ > }
|
|
|
+4. 增加路由插件vue-router ``npm install vue-router@4``,使用HTML5模式。
|
|
|
+ 在src路径下新建router文件夹,在``main.ts``中加载注册使用。
|
|
|
+5. 添加elementui插件 ``npm install element-plus --save``。
|
|
|
+ 在``main.ts``中引用使用。
|
|
|
+ > import 'element-plus/dist/index.css'
|
|
|
+ > import 'element-plus/theme-chalk/dark/css-vars.css'
|
|
|
+6. 添加pinia插件, ``npm install pinia --save``。
|
|
|
+ 在``main.ts``中加载注册使用。
|
|
|
+ > import { createPinia } from 'pinia'
|
|
|
+ > const pinia = createPinia();
|
|
|
+7. 添加sass 插件, ``npm install sass --save``
|
|
|
+8. 新增使用svg图片的功能。
|
|
|
+ 使用vite-plugin-svg-icons插件,还需要安装下fast-glob相关依赖。
|
|
|
+
|