{"_id":"@39nyx/dumi-plugin-preset-vue2","_rev":"5-9e43d778e483fec3f53bf400a435eac2","name":"@39nyx/dumi-plugin-preset-vue2","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.0":{"name":"@39nyx/dumi-plugin-preset-vue2","version":"1.0.0","keywords":["dumi","plugin","preset","vue"],"license":"MIT","_id":"@39nyx/dumi-plugin-preset-vue2@1.0.0","maintainers":[{"name":"hzjanger","email":"1305696249@qq.com"}],"dist":{"shasum":"23b6e7d9437345b51c1d9f5ec1ce3a7f28345013","tarball":"https://registry.npmjs.org/@39nyx/dumi-plugin-preset-vue2/-/dumi-plugin-preset-vue2-1.0.0.tgz","fileCount":41,"integrity":"sha512-DEUjZSQBbJCZXEs/O8BIRUjl2NXXCZpvci388x0hkPZwNv7Qxtz5qPX1PiRFAYE3rKiXbLow2MHARgTXzwp2dA==","signatures":[{"sig":"MEUCIGzcg7eKDmiZPTMTT37tvmp1MgnpMp5oQLyfGKDDfiNuAiEA52QbK3fQ2v48STKdHEkrrq2xNQMDJAuCMNklbhgtOA4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1407845},"main":"dist/index.js","types":"dist/index.d.ts","authors":["jeffwcx <jeffwcx@icloud.com>"],"gitHead":"cf44d16ce6f147884485fb796d2e8efb010adf12","scripts":{"dev":"father dev","test":"vitest","build":"father build","build:lib":"tsup --minify","build:deps":"father prebundle"},"_npmUser":{"name":"hzjanger","email":"1305696249@qq.com"},"_npmVersion":"10.9.2","description":"Vue support plugins for dumi","directories":{},"_nodeVersion":"22.13.0","dependencies":{"vue":"^2.7.16","hash-sum":"^2.0.0","element-ui":"^2.15.14","vue-loader":"^17.0.1","@types/hash-sum":"^1.0.0","@dumijs/vue-meta":"^2.4.14","compare-versions":"^6.1.0","@vue/compiler-sfc":"^3.5.13","dumi-assets-types":"^2.4.14","vue-template-compiler":"2.7.16","@umijs/bundler-webpack":"^4.0.81","codesandbox-import-utils":"^2.2.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"dumi":"^2.4.20","tsup":"^8.0.1","father":"^4.1.9","@umijs/core":"^4.4.10","@types/babel__core":"^7.20.5","@vue/babel-plugin-jsx":"^1.1.6","@types/babel__standalone":"^7.1.7"},"peerDependencies":{"vue":"^2.7.16","dumi":"^2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/dumi-plugin-preset-vue2_1.0.0_1754569551653_0.0026849961726238547","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@39nyx/dumi-plugin-preset-vue2","version":"1.0.1","keywords":["dumi","plugin","preset","vue"],"license":"MIT","_id":"@39nyx/dumi-plugin-preset-vue2@1.0.1","maintainers":[{"name":"hzjanger","email":"1305696249@qq.com"}],"dist":{"shasum":"f32174ef0d0b511f03290d3a7945f38ebd2bc114","tarball":"https://registry.npmjs.org/@39nyx/dumi-plugin-preset-vue2/-/dumi-plugin-preset-vue2-1.0.1.tgz","fileCount":40,"integrity":"sha512-KNyTDhNv2UJ2pQ6J5IcA3xYH62Hw8o4alHGx4sMEPeXV3cIv4e8aLh/GSkQSCkjx87kjB/Ysv0Gnxi0WFXSwug==","signatures":[{"sig":"MEUCIGulJEciVtlCn37AqjWcR0268JMQuewtUZP+HjOxmSSWAiEAoAdf+s0Cl5Fs3gdKMwKlooyAHO9r+FiniVVxqxETz8I=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":749458},"main":"dist/index.js","_from":"file:39nyx-dumi-plugin-preset-vue2-1.0.1.tgz","types":"dist/index.d.ts","authors":["jeffwcx <jeffwcx@icloud.com>"],"scripts":{"dev":"father dev","test":"vitest","build":"father build","build:lib":"tsup --minify","build:deps":"father prebundle"},"_npmUser":{"name":"hzjanger","email":"1305696249@qq.com"},"_resolved":"/private/var/folders/z6/mpg841b169b58xx1yjzsbnnh0000gn/T/307c2c75fd0303c73a5ec3a6e4f58e51/39nyx-dumi-plugin-preset-vue2-1.0.1.tgz","_integrity":"sha512-KNyTDhNv2UJ2pQ6J5IcA3xYH62Hw8o4alHGx4sMEPeXV3cIv4e8aLh/GSkQSCkjx87kjB/Ysv0Gnxi0WFXSwug==","_npmVersion":"10.9.2","description":"Vue support plugins for dumi","directories":{},"_nodeVersion":"22.13.0","dependencies":{"vue":"^2.7.16","hash-sum":"^2.0.0","element-ui":"^2.15.14","vue-loader":"^17.0.1","@types/hash-sum":"^1.0.0","@dumijs/vue-meta":"^2.4.14","compare-versions":"^6.1.0","@vue/compiler-sfc":"^3.5.13","dumi-assets-types":"^2.4.14","vue-template-compiler":"2.7.16","@umijs/bundler-webpack":"^4.0.81","codesandbox-import-utils":"^2.2.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"dumi":"^2.4.20","tsup":"^8.0.1","father":"^4.1.9","@umijs/core":"^4.4.10","@types/babel__core":"^7.20.5","@vue/babel-plugin-jsx":"^1.1.6","@types/babel__standalone":"^7.1.7"},"peerDependencies":{"vue":"^2.7.16","dumi":"^2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/dumi-plugin-preset-vue2_1.0.1_1754665145768_0.21633806951777257","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@39nyx/dumi-plugin-preset-vue2","version":"1.0.2","keywords":["dumi","plugin","preset","vue"],"license":"MIT","_id":"@39nyx/dumi-plugin-preset-vue2@1.0.2","maintainers":[{"name":"hzjanger","email":"1305696249@qq.com"}],"homepage":"https://github.com/39Nyx/dumi-preset-vue2#readme","bugs":{"url":"https://github.com/39Nyx/dumi-preset-vue2/issues"},"dist":{"shasum":"6dc042ca273659b65b5e0ef11e246223f3579c6b","tarball":"https://registry.npmjs.org/@39nyx/dumi-plugin-preset-vue2/-/dumi-plugin-preset-vue2-1.0.2.tgz","fileCount":38,"integrity":"sha512-euTGjIAiBkkofFbVsN2W68ah8jP8ZyZ8sXo0WnLN1wVkRepi1pfSZXYnaD3QSUCY4FS9yMZ1gZ3W3ZkRVx+pmQ==","signatures":[{"sig":"MEYCIQD9sfbERDbFZ0loX9nXzN7ZAnhkXXHBKwfQc8mkKFnk2AIhANus/DiGeLessJCPnvNH4CAS2aNA7+jKbXQVd2LdSLDs","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":749372},"main":"dist/index.js","_from":"file:39nyx-dumi-plugin-preset-vue2-1.0.2.tgz","types":"dist/index.d.ts","authors":["hzj <hezhijian@qq.com>"],"scripts":{"dev":"father dev","test":"vitest","build":"father build","build:lib":"tsup --minify","build:deps":"father prebundle"},"_npmUser":{"name":"hzjanger","email":"1305696249@qq.com"},"_resolved":"/private/var/folders/z6/mpg841b169b58xx1yjzsbnnh0000gn/T/a28ac530ac4ce15588e8eb5a22fa4c6f/39nyx-dumi-plugin-preset-vue2-1.0.2.tgz","_integrity":"sha512-euTGjIAiBkkofFbVsN2W68ah8jP8ZyZ8sXo0WnLN1wVkRepi1pfSZXYnaD3QSUCY4FS9yMZ1gZ3W3ZkRVx+pmQ==","repository":{"url":"git+https://github.com/39Nyx/dumi-preset-vue2.git","type":"git"},"_npmVersion":"10.9.2","description":"Vue support plugins for dumi","directories":{},"_nodeVersion":"22.13.0","dependencies":{"vue":"^2.7.16","hash-sum":"^2.0.0","element-ui":"^2.15.14","vue-loader":"^17.0.1","@types/hash-sum":"^1.0.0","@dumijs/vue-meta":"^2.4.14","compare-versions":"^6.1.0","@vue/compiler-sfc":"^3.5.13","dumi-assets-types":"^2.4.14","vue-template-compiler":"2.7.16","@umijs/bundler-webpack":"^4.0.81","codesandbox-import-utils":"^2.2.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"dumi":"^2.4.20","tsup":"^8.0.1","father":"^4.1.9","@umijs/core":"^4.4.10","@types/babel__core":"^7.20.5","@vue/babel-plugin-jsx":"^1.1.6","@types/babel__standalone":"^7.1.7"},"peerDependencies":{"vue":"^2.7.16","dumi":"^2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/dumi-plugin-preset-vue2_1.0.2_1754718743260_0.5890767788659521","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@39nyx/dumi-plugin-preset-vue2","version":"1.0.3","keywords":["dumi","plugin","preset","vue"],"license":"MIT","_id":"@39nyx/dumi-plugin-preset-vue2@1.0.3","maintainers":[{"name":"hzjanger","email":"1305696249@qq.com"}],"homepage":"https://github.com/39Nyx/dumi-preset-vue2#readme","bugs":{"url":"https://github.com/39Nyx/dumi-preset-vue2/issues"},"dist":{"shasum":"ad1d3a00ba58338a57389b741d11974d42415400","tarball":"https://registry.npmjs.org/@39nyx/dumi-plugin-preset-vue2/-/dumi-plugin-preset-vue2-1.0.3.tgz","fileCount":38,"integrity":"sha512-j8us0llB+Cq5wGYdJZ6rImXrkMI6eWhOZhLgbDrcfMvAdIDTOq4+A69Z1XYkV4LjaJoT4DO1FJcAMgP4Knvv1g==","signatures":[{"sig":"MEUCIFLD74956sCY0QKkD3vjsDMYoVyJduFqBHH6PKu1KOGhAiEAhx/KtJDOfjQ25oIA9RdH7BaWuCJWh+rIoh9nqQs78tE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":749545},"main":"dist/index.js","_from":"file:39nyx-dumi-plugin-preset-vue2-1.0.3.tgz","types":"dist/index.d.ts","authors":["hzj <hezhijian@qq.com>"],"scripts":{"dev":"father dev","test":"vitest","build":"father build","build:lib":"tsup --minify","build:deps":"father prebundle"},"_npmUser":{"name":"hzjanger","email":"1305696249@qq.com"},"_resolved":"/private/var/folders/z6/mpg841b169b58xx1yjzsbnnh0000gn/T/8ec88e56d4f59264b0b4ae601df5da40/39nyx-dumi-plugin-preset-vue2-1.0.3.tgz","_integrity":"sha512-j8us0llB+Cq5wGYdJZ6rImXrkMI6eWhOZhLgbDrcfMvAdIDTOq4+A69Z1XYkV4LjaJoT4DO1FJcAMgP4Knvv1g==","repository":{"url":"git+https://github.com/39Nyx/dumi-preset-vue2.git","type":"git"},"_npmVersion":"10.9.2","description":"Vue support plugins for dumi","directories":{},"_nodeVersion":"22.13.0","dependencies":{"vue":"~2.6","hash-sum":"^2.0.0","element-ui":"^2.15.14","vue-loader":"^17.0.1","@types/hash-sum":"^1.0.0","@dumijs/vue-meta":"^2.4.14","compare-versions":"^6.1.0","@vue/compiler-sfc":"^3.5.13","dumi-assets-types":"^2.4.14","vue-template-compiler":"~2.6","@umijs/bundler-webpack":"^4.0.81","codesandbox-import-utils":"^2.2.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"dumi":"^2.4.20","tsup":"^8.0.1","father":"^4.1.9","@umijs/core":"^4.4.10","@types/babel__core":"^7.20.5","@vue/babel-plugin-jsx":"^1.1.6","@types/babel__standalone":"^7.1.7"},"peerDependencies":{"vue":"^2.6","dumi":"^2.0.0","vue-template-compiler":"^2.6"},"_npmOperationalInternal":{"tmp":"tmp/dumi-plugin-preset-vue2_1.0.3_1754924421271_0.6382736139866698","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@39nyx/dumi-plugin-preset-vue2","version":"1.0.4","description":"Vue support plugins for dumi","keywords":["dumi","plugin","preset","vue"],"license":"MIT","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git+https://github.com/39Nyx/dumi-preset-vue2.git"},"scripts":{"build":"father build","build:deps":"father prebundle","build:lib":"tsup --minify","dev":"father dev","test":"vitest"},"dependencies":{"@dumijs/vue-meta":"^2.4.14","@types/hash-sum":"^1.0.0","@umijs/bundler-webpack":"^4.0.81","@vue/compiler-sfc":"^3.5.13","codesandbox-import-utils":"^2.2.3","compare-versions":"^6.1.0","dumi-assets-types":"^2.4.14","element-ui":"^2.15.14","hash-sum":"^2.0.0","vue":"~2.6","vue-loader":"^17.0.1","vue-template-compiler":"~2.6"},"devDependencies":{"@types/babel__core":"^7.20.5","@types/babel__standalone":"^7.1.7","@umijs/core":"^4.4.10","@vue/babel-plugin-jsx":"^1.1.6","dumi":"^2.4.20","father":"^4.1.9","tsup":"^8.0.1"},"peerDependencies":{"dumi":"^2.0.0","vue":"^2.6","vue-template-compiler":"^2.6"},"publishConfig":{"access":"public"},"authors":["hzj <hezhijian@qq.com>"],"_id":"@39nyx/dumi-plugin-preset-vue2@1.0.4","gitHead":"6bab5d4c3b80dbbd6878f3adcff485fc789a6dc9","bugs":{"url":"https://github.com/39Nyx/dumi-preset-vue2/issues"},"homepage":"https://github.com/39Nyx/dumi-preset-vue2#readme","_nodeVersion":"22.13.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-em3sJ17v/AiWtL2P7L3qYAkvh0a64h0xD5TrzopyQv4OkcQIVjRqjHF6ucQYWhMkTytFbxmp4HW9KW860Ws8Ag==","shasum":"573043699439e9893cd0e5439fff4284e7d21a8f","tarball":"https://registry.npmjs.org/@39nyx/dumi-plugin-preset-vue2/-/dumi-plugin-preset-vue2-1.0.4.tgz","fileCount":38,"unpackedSize":749422,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHsfB40hxMbnMcNLVeBzxyOk/SIZFZue8zlvgxbA8rIMAiEAjh3XLGTKPz0/75q2xBqJLwBIkgjvfYSlPLDzLt0dS9I="}]},"_npmUser":{"name":"hzjanger","email":"1305696249@qq.com"},"directories":{},"maintainers":[{"name":"hzjanger","email":"1305696249@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dumi-plugin-preset-vue2_1.0.4_1756050064999_0.8816282582947887"},"_hasShrinkwrap":false}},"time":{"created":"2025-08-07T12:25:51.598Z","modified":"2025-08-24T15:41:05.487Z","1.0.0":"2025-08-07T12:25:51.863Z","1.0.1":"2025-08-08T14:59:05.995Z","1.0.2":"2025-08-09T05:52:23.516Z","1.0.3":"2025-08-11T15:00:21.515Z","1.0.4":"2025-08-24T15:41:05.276Z"},"bugs":{"url":"https://github.com/39Nyx/dumi-preset-vue2/issues"},"license":"MIT","homepage":"https://github.com/39Nyx/dumi-preset-vue2#readme","keywords":["dumi","plugin","preset","vue"],"repository":{"type":"git","url":"git+https://github.com/39Nyx/dumi-preset-vue2.git"},"description":"Vue support plugins for dumi","maintainers":[{"name":"hzjanger","email":"1305696249@qq.com"}],"readme":"# @39nyx/dumi-plugin-preset-vue2\n\n此项目是根据官方的[dumi-theme-vue](https://github.com/umijs/dumi/tree/master/suites/preset-vue)插件进行修改，做了vue2版本的适配。\n\n## 安装\n\n```shell [pnpm]\npnpm add @39nyx/dumi-plugin-preset-vue2\n```\n\n## 配置\n\n在 `dumi.config.ts` 中引入插件：\n\n```typescript\nimport { defineConfig } from 'dumi';\n\nexport default defineConfig({\n  presets: ['@39nyx/dumi-plugin-preset-vue2'],\n});\n```\n\n## 集成第三方组件库\n\n集成`element-ui`组件库为例, 需要注意如果集成`element-ui`组件库`vue`的版本不能超过`2.7.0`，否则`el-table`组件不会渲染。\n\n在根目录创建`runtime`文件夹，在文件夹下创建`renderer.js`文件, 内容如下\n\n```javascript\nimport Vue from 'vue';\n\n// 集成ElementUI, 其他组件类似\nimport ElementUI from 'element-ui'\nimport 'element-ui/lib/theme-chalk/index.css'\n\nVue.use(ElementUI)\n\n// 创建实例前配置全局错误处理\nVue.config.errorHandler = function (err, vm, info) {\n  // 在此处理错误（如发送日志、抛给上层）\n  console.error('Vue 错误:', err, info);\n\n  // 如果需要抛给外部（如 React 错误边界）\n  throw err; // 抛出错误让上层捕获\n};\n\nconst renderer = async function (canvas, component) {\n  if (component.__css__) {\n    setTimeout(() => {\n      document\n        .querySelectorAll(`style[css-${component.__id__}]`)\n        .forEach((el) => el.remove());\n      document.head.insertAdjacentHTML(\n        'beforeend',\n        `<style css-${component.__id__}>${component.__css__}</style>`,\n      );\n    }, 1);\n  }\n  const app = new Vue(component)\n  app.$mount(canvas);\n  return () => {\n    app.$destroy();\n  };\n};\n\nexport default renderer;\n```\n\n这里需要导出一个渲染函数, 是一定要实现的, 上面的`renderer`函数是一个通用实现，可以也可根据实际情况进行修改。\n\n然后在`dumi.config.ts`中配置`runtime`路径\n\n```typescript\nimport { defineConfig } from 'dumi';\n\nexport default defineConfig({\n  presets: ['@39nyx/dumi-plugin-preset-vue2'],\n  vue: {\n    compiler: {\n      // 配置创建好的渲染函数路径, 如果不配置，会使用默认提供的渲染函数\n      rendererPath: 'runtime/renderer.js'\n    }\n  },\n});\n```\n\n## babelStandaloneCDN 配置\n\n`@babel/standalone`默认加载地址是`https://cdn.bootcdn.net/ajax/libs/babel-standalone/7.22.17/babel.min.js`, 如果需要自定义加载地址，可以在`dumi.config.ts`中配置`babelStandaloneCDN`参数。\n\n```typescript\nimport { defineConfig } from 'dumi';\n\nexport default defineConfig({\n  presets: ['@39nyx/dumi-plugin-preset-vue2'],\n  vue: {\n    compiler: {\n      // 如果不配置，会使用默认地址: https://cdn.bootcdn.net/ajax/libs/babel-standalone/7.22.17/babel.min.j\n      babelStandaloneCDN: '更改为自定义加载地址'\n    }\n  },\n});\n```","readmeFilename":"README.md"}