流浪のwolf

卷帝

导航

2023年3月11日

vue3自动导入 api ,不需要多次导入 api 了

摘要: 安装插件 npm i -D unplugin-auto-import 配置 vite.config.js export default defineConfig({ plugins: [ vue(), AutoImport({ imports: ["vue"], dts: "auto-imports 阅读全文

posted @ 2023-03-11 19:47 流浪のwolf 阅读(19) 评论(0) 推荐(0) 编辑

vue3中没有 this 环境变量了

摘要: 因为 api setup 在 beforecreate 之前执行,所以 this 是 undefined ; setup 不能是一个 async 函数 ,因为返回值不是 对象了 ,而是 promise ;如果要使用 async 就要配合 suspense 组件使用 ; 阅读全文

posted @ 2023-03-11 19:01 流浪のwolf 阅读(43) 评论(0) 推荐(0) 编辑

vue2 + webpack 分析报告 report == webpack-bundle-analyzer

摘要: packjson.js 配置 "build-report":"vue-cli-service build --report", 执行 : npm run build-report 阅读全文

posted @ 2023-03-11 18:36 流浪のwolf 阅读(17) 评论(0) 推荐(0) 编辑

vue3 + vite 分析报告 report == rollup-plugin-visualizer

摘要: 安装插件 npm i rollup-plugin-visualizer -D 配置vite.config.js 文件 【加入插件】 import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' import { vi 阅读全文

posted @ 2023-03-11 18:34 流浪のwolf 阅读(270) 评论(0) 推荐(0) 编辑