随笔分类 - vue
摘要:报错截图 定位 !isBoolean && (typeof value!='string') && (typeof value !='number') && (typeof value !='boolean')
阅读全文
摘要:状态保存 const initHmr = function(app: App) { const env = getEnv(); if (env.env !== "dev") { return; } app.mixin({ created() { if (import.meta.hot) { cons
阅读全文
摘要:nodejs import * as fs from "node:fs"; const convertFileCode = function (path) { if (!path.endsWith(".vue")) { return; } const res = fs.readFileSync(pa
阅读全文
摘要:异步组件 <template> <Suspense v-if="!routerLoading"> <template #default> <AsyncComp /> </template> <template #fallback> <div class="loading-container"> <d
阅读全文
摘要:reload优化 预构建 optimizeDeps: { exclude: ["@jhlc/utils", "@jhlc/types", "pdfjs-dist", "echarts", "dayjs"] }, 生产环境去掉console log和debugger esbuild: { drop:
阅读全文
摘要:vite https接口 server: { hmr: true, port: 8002, host: '0.0.0.0', proxy: { '/dev-api': { // target: 'http://127.0.0.1:9000', // 接口基地址 // target: 'http://
阅读全文
摘要:vue模板编译器 import {ASTElement, compile} from 'vue-template-compiler'; import {TableColumnDesc} from "@/components/table/base-table/type.ts"; export cons
阅读全文
摘要:异步组件内插槽无法获取组件实例 app.component( cName, defineAsyncComponent(async () => { this.registryNumber++; await setComponentOptions(component); return new Promi
阅读全文
摘要:依赖 "vitest": "0.34.6", "@vue/test-utils": "2.4.3", "axios-mock-adapter": "^1.22.0", 示例 import { mount } from "@vue/test-utils"; import { test, vi } fr
阅读全文
摘要:proxy: { "/dev-api": { target: "http://172.18.247.123:9000", rewrite: (path) => path.replace(/^/dev-api/, ''), configure: (proxy, _options) => { proxy
阅读全文
摘要:### 环境 1. vue3 2. "vuedraggable": "^4.1.0" ### 物料区 ```vue {{ element.name }} ``` ### 预览区 ```vue {{ element.name }} ``` ### iframe ```vue ```
阅读全文
摘要:### rollup-plugin-visualizer 打包耗时打印 ```shell pnpm add rollup-plugin-visualizer -D ``` ```ts import { visualizer } from 'rollup-plugin-visualizer'; exp
阅读全文
摘要:withKeys withModifiers 触发render机制 @keyup.enter vue <div @keyup.enter>Hello World</div> js import { withKeys as _withKeys, openBlock as _openBlock, cre
阅读全文
摘要:使用vite创建项目 npm init vite vscode配置 jsconfig.json { "include": [ "./src/**/*" ], "compilerOptions": { "baseUrl": ".", "paths": { "@/*": ["./src/*"] } }
阅读全文
摘要:vite.config.js import {defineConfig} from 'vite' import vue from '@vitejs/plugin-vue' import AutoImport from 'unplugin-auto-import/vite' // vite.confi
阅读全文
摘要:场景 插槽内部无法向上抛出 onUpdate:modelValue事件 let children = h(resolveComponent('draggable'), { class: 'draggable-box', id: name, itemKey: 'cid', group: 'formGr
阅读全文
摘要:ref 渲染时挂载ref result.ref = el => { if (node.cid) { pageConfig().putDomRef(node.cid as string, el); } } v-model实现 import {defineComponent, h, ref, resol
阅读全文
摘要:必须响应式 let config: ElementNode = { tag: 'div', isHtml: true, type: 'success', children: [{ tag: 'FormComponent', size: 'big', inline: true, list: react
阅读全文
浙公网安备 33010602011771号