Coder Social home page Coder Social logo

dewfall123 / vitepress-for-component Goto Github PK

View Code? Open in Web Editor NEW
194.0 194.0 38.0 4.47 MB

📖 针对组件开发的VitePress。 重构版本https://github.com/dewfall123/ruabick

Home Page: https://dewfall123.github.io/vitepress-for-component/

License: MIT License

JavaScript 2.65% TypeScript 61.87% Vue 27.14% CSS 8.34%
component documentation-generator dumi vitepress vue vue-components vue3

vitepress-for-component's People

Contributors

1wkk avatar airene avatar antfu avatar austintoddj avatar choysen avatar chrisshank avatar dependabot[bot] avatar dewfall123 avatar dnischeta avatar elmassimo avatar em2046 avatar hcg1023 avatar heny avatar kazupon avatar kiaking avatar m4dz avatar meteorlxy avatar nicong622 avatar nikkolast88 avatar patak-dev avatar pikax avatar posva avatar qdbest avatar spice-z avatar takurinton avatar tolking avatar wizard67 avatar yunyoujun avatar yyx990803 avatar zouhangwithsweet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

vitepress-for-component's Issues

vite添加enhanceApp 报错

Describe the bug
.vitepress/theme/index.js 添加enhanceApp 报错

To Reproduce
Steps to reproduce the behavior:
.vitepress/theme/index.js 创建文件
添加代码如下:
image

Expected behavior
A clear and concise description of what you expected to happen.
期望是正常的,但是页面是报错了,runtime-core.esm-bundler.js:6568 [Vue warn]: Invalid vnode type when creating vnode: undefined.
at
System Info

  • vitepress-for-component version: ^0.16.2
  • vite version: ^2.4.1
  • Node version:
  • OS version: macos

Additional context
Add any other context about the problem here.

打包后样式不一致问题

能不能把默认css样式也一同打包,我发现组件发布的样式和这个项目预览的不一样,例如,用这个文档会默认为table表格加一些样式,但是打包之后,样式没有了,看起来很不一致。而且我无法得知默认样式有哪些

运行报错

您好,我尝试把这个项目拉取下来,想基于您这个自己二次开发。

但是当我拉取项目运行以后,浏览器提示报错,运行不起来。

image

image

电脑系统版本:macOs Big sur 11.6.2
npm版本:8.3.0
node版本:16.6.1
vitepress-for-component版本:0.16.9 ,分支:master

命令:

  1. npm install
  2. npm run dev
  3. npm run docs

build 后页面布局异常

Describe the bug

执行 docs-build-serve 命令后打开网页样式错误,dev 时一切正常

To Reproduce

  1. run yarn docs-build-serve
  2. open URL

Expected behavior

网页样式正常

System Info

  • vitepress-for-component version:0.14.2/0.13.1
  • vite version:v2.1.5
  • Node version:v12.18.3
  • OS version:Windows 10.0 20H2; x64

Additional context
image

相关 github 地址:https://github.com/fuzhoujohn/bass-ui

关于部署配置

我通过 脚手架 创建一个项目 vue-docs,用的这个 vue-multiple-components 模板, 打包部署在 netilfy 上。指定文档目录在 docs/dist,打开html 引入路径的 路径 通通都有 vue-docs/ , 导致 404

我尝试修改 base, title 这些,然后 执行 npm run docs-build, 依然没有修改成功

请问我应该怎么做?

能否支持Iframe模式,

vuepress目前不支持iframe模式, dumi是将所有组件打成一个包,所以的组件都可以单独访问

打包后样式不一致问题

能不能把默认css样式也一同打包,我发现组件发布的样式和这个项目预览的不一样,例如,用这个文档会默认为table表格加一些样式,但是打包之后,样式没有了,看起来很不一致。而且我无法得知默认样式有哪些

无法查看 CodePen 代码示例

点击查看代码示例后,发现合成的代码有问题,无法预览 :-(

另外,如何开启 CodesandBox 预览呢? @dewfall123

image

new Vue({
	el: '#app', 
	import { useSize } from 'ahooks-vue';
import { ref } from 'vue';

  setup() {
    const divRef = ref(null);
    const size = useSize(divRef, {
      onChange: () => {
        console.log('size change');
      },
    });

    return {
      divRef,
      size,
    };
  },
};
})

<template functional> is no longer supported in Vue 3

Describe the bug
I ran yarn create vlib and then completed all the choices, under vue-multiple-components mode, whereafter I ran npm install, showing logs provided below

➜  fuckup npm install 
npm WARN deprecated [email protected]: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: This module has moved and is now available at @rollup/plugin-alias. Please update your dependencies. This version is no longer maintained.
npm WARN deprecated [email protected]: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-commonjs.

added 1527 packages, and audited 1528 packages in 7m

110 packages are looking for funding
  run `npm fund` for details

7 vulnerabilities (3 moderate, 4 high)

To address all issues, run:
  npm audit fix

Run `npm audit` for details.

I, then, ran npm run dev, having this as the output:

➜  fuckup npm run dev

> [email protected] dev
> vitepress-fc dev --root=docs

vitepress v0.14.0
vite v2.0.5
root = docs/.temp
copy to .temp success.
Pre-bundling dependencies:
  vue
(this will be run only when your dependencies or config have changed)

  vite v2.0.5 dev server running at:

  > Local:    http://localhost:3000/
  > Network:  http://192.168.0.100:3000/
[@vue/compiler-sfc] <script setup> is still an experimental proposal.
Follow its status at https://github.com/vuejs/rfcs/pull/227.

[@vue/compiler-sfc] When using experimental features,
it is recommended to pin your vue dependencies to exact versions to avoid breakage.

[@vue/compiler-sfc] `defineProps` is a compiler macro and no longer needs to be imported.

[@vue/compiler-sfc] `defineEmit` is a compiler macro and no longer needs to be imported.

12:53:08 [vite] Internal server error: <template functional> is no longer supported in Vue 3, since functional components no longer have significant performance difference from stateful ones. Just use a normal <template> instead.
  Plugin: vite:vue
  File: /Users/admin/projects/vue/fuckup/node_modules/vitepress-for-component/dist/client/theme-default/components/icons/ArrowLeft.vue
      at /Users/admin/projects/vue/fuckup/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:196:37
      at Array.forEach (<anonymous>)
      at Object.parse (/Users/admin/projects/vue/fuckup/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:182:18)
      at createDescriptor (/Users/admin/projects/vue/fuckup/node_modules/@vitejs/plugin-vue/dist/index.js:4392:52)
      at transformMain (/Users/admin/projects/vue/fuckup/node_modules/@vitejs/plugin-vue/dist/index.js:4694:32)
      at TransformContext.transform (/Users/admin/projects/vue/fuckup/node_modules/@vitejs/plugin-vue/dist/index.js:5016:16)
      at Object.transform (/Users/admin/projects/vue/fuckup/node_modules/vite/dist/node/chunks/dep-e0f09032.js:46027:53)
      at async transformRequest (/Users/admin/projects/vue/fuckup/node_modules/vite/dist/node/chunks/dep-e0f09032.js:61631:29)
      at async /Users/admin/projects/vue/fuckup/node_modules/vite/dist/node/chunks/dep-e0f09032.js:61739:32
12:53:09 [vite] Internal server error: <template functional> is no longer supported in Vue 3, since functional components no longer have significant performance difference from stateful ones. Just use a normal <template> instead.
  Plugin: vite:vue
  File: /Users/admin/projects/vue/fuckup/node_modules/vitepress-for-component/dist/client/theme-default/components/icons/ArrowRight.vue
      at /Users/admin/projects/vue/fuckup/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:196:37
      at Array.forEach (<anonymous>)
      at Object.parse (/Users/admin/projects/vue/fuckup/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:182:18)
      at createDescriptor (/Users/admin/projects/vue/fuckup/node_modules/@vitejs/plugin-vue/dist/index.js:4392:52)
      at transformMain (/Users/admin/projects/vue/fuckup/node_modules/@vitejs/plugin-vue/dist/index.js:4694:32)
      at TransformContext.transform (/Users/admin/projects/vue/fuckup/node_modules/@vitejs/plugin-vue/dist/index.js:5016:16)
      at Object.transform (/Users/admin/projects/vue/fuckup/node_modules/vite/dist/node/chunks/dep-e0f09032.js:46027:53)
      at async transformRequest (/Users/admin/projects/vue/fuckup/node_modules/vite/dist/node/chunks/dep-e0f09032.js:61631:29)
      at async /Users/admin/projects/vue/fuckup/node_modules/vite/dist/node/chunks/dep-e0f09032.js:61739:32
12:53:09 [vite] Internal server error: <template functional> is no longer supported in Vue 3, since functional components no longer have significant performance difference from stateful ones. Just use a normal <template> instead.
  Plugin: vite:vue
  File: /Users/admin/projects/vue/fuckup/node_modules/vitepress-for-component/dist/client/theme-default/components/icons/OutboundLink.vue
      at /Users/admin/projects/vue/fuckup/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:196:37
      at Array.forEach (<anonymous>)
      at Object.parse (/Users/admin/projects/vue/fuckup/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:182:18)
      at createDescriptor (/Users/admin/projects/vue/fuckup/node_modules/@vitejs/plugin-vue/dist/index.js:4392:52)
      at transformMain (/Users/admin/projects/vue/fuckup/node_modules/@vitejs/plugin-vue/dist/index.js:4694:32)
      at TransformContext.transform (/Users/admin/projects/vue/fuckup/node_modules/@vitejs/plugin-vue/dist/index.js:5016:16)
      at Object.transform (/Users/admin/projects/vue/fuckup/node_modules/vite/dist/node/chunks/dep-e0f09032.js:46027:53)
      at async transformRequest (/Users/admin/projects/vue/fuckup/node_modules/vite/dist/node/chunks/dep-e0f09032.js:61631:29)
      at async /Users/admin/projects/vue/fuckup/node_modules/vite/dist/node/chunks/dep-e0f09032.js:61739:32
12:53:30 [vite] Internal server error: /Users/admin/projects/vue/polyeth-docs/node_modules/vitepress/dist/client/theme-default/components/icons/OutboundLink.vue has no corresponding SFC entry in the cache. This is a @vitejs/plugin-vue internal error, please open an issue.
      at getDescriptor (/Users/admin/projects/vue/fuckup/node_modules/@vitejs/plugin-vue/dist/index.js:4412:11)
      at Context.load (/Users/admin/projects/vue/fuckup/node_modules/@vitejs/plugin-vue/dist/index.js:4991:28)
      at Object.load (/Users/admin/projects/vue/fuckup/node_modules/vite/dist/node/chunks/dep-e0f09032.js:46008:50)
      at processTicksAndRejections (internal/process/task_queues.js:93:5)
      at async transformRequest (/Users/admin/projects/vue/fuckup/node_modules/vite/dist/node/chunks/dep-e0f09032.js:61574:24)
      at async /Users/admin/projects/vue/fuckup/node_modules/vite/dist/node/chunks/dep-e0f09032.js:61739:32
12:53:30 [vite] Internal server error: /Users/admin/projects/vue/polyeth-docs/node_modules/vitepress/dist/client/theme-default/components/NavDropdownLinkItem.vue has no corresponding SFC entry in the cache. This is a @vitejs/plugin-vue internal error, please open an issue.
      at getDescriptor (/Users/admin/projects/vue/fuckup/node_modules/@vitejs/plugin-vue/dist/index.js:4412:11)
      at Context.load (/Users/admin/projects/vue/fuckup/node_modules/@vitejs/plugin-vue/dist/index.js:4991:28)
      at Object.load (/Users/admin/projects/vue/fuckup/node_modules/vite/dist/node/chunks/dep-e0f09032.js:46008:50)
      at processTicksAndRejections (internal/process/task_queues.js:93:5)
      at async transformRequest (/Users/admin/projects/vue/fuckup/node_modules/vite/dist/node/chunks/dep-e0f09032.js:61574:24)
      at async /Users/admin/projects/vue/fuckup/node_modules/vite/dist/node/chunks/dep-e0f09032.js:61739:32
12:53:31 [vite] Internal server error: <template functional> is no longer supported in Vue 3, since functional components no longer have significant performance difference from stateful ones. Just use a normal <template> instead.
  Plugin: vite:vue
  File: /Users/admin/projects/vue/fuckup/node_modules/vitepress-for-component/dist/client/theme-default/components/icons/ArrowRight.vue
      at /Users/admin/projects/vue/fuckup/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:196:37
      at Array.forEach (<anonymous>)
      at Object.parse (/Users/admin/projects/vue/fuckup/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:182:18)
      at createDescriptor (/Users/admin/projects/vue/fuckup/node_modules/@vitejs/plugin-vue/dist/index.js:4392:52)
      at transformMain (/Users/admin/projects/vue/fuckup/node_modules/@vitejs/plugin-vue/dist/index.js:4694:32)
      at TransformContext.transform (/Users/admin/projects/vue/fuckup/node_modules/@vitejs/plugin-vue/dist/index.js:5016:16)
      at Object.transform (/Users/admin/projects/vue/fuckup/node_modules/vite/dist/node/chunks/dep-e0f09032.js:46027:53)
      at async transformRequest (/Users/admin/projects/vue/fuckup/node_modules/vite/dist/node/chunks/dep-e0f09032.js:61631:29)
      at async /Users/admin/projects/vue/fuckup/node_modules/vite/dist/node/chunks/dep-e0f09032.js:61739:32
12:53:31 [vite] Internal server error: <template functional> is no longer supported in Vue 3, since functional components no longer have significant performance difference from stateful ones. Just use a normal <template> instead.
  Plugin: vite:vue
  File: /Users/admin/projects/vue/fuckup/node_modules/vitepress-for-component/dist/client/theme-default/components/icons/ArrowLeft.vue
      at /Users/admin/projects/vue/fuckup/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:196:37
      at Array.forEach (<anonymous>)
      at Object.parse (/Users/admin/projects/vue/fuckup/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:182:18)
      at createDescriptor (/Users/admin/projects/vue/fuckup/node_modules/@vitejs/plugin-vue/dist/index.js:4392:52)
      at transformMain (/Users/admin/projects/vue/fuckup/node_modules/@vitejs/plugin-vue/dist/index.js:4694:32)
      at TransformContext.transform (/Users/admin/projects/vue/fuckup/node_modules/@vitejs/plugin-vue/dist/index.js:5016:16)
      at Object.transform (/Users/admin/projects/vue/fuckup/node_modules/vite/dist/node/chunks/dep-e0f09032.js:46027:53)
      at async transformRequest (/Users/admin/projects/vue/fuckup/node_modules/vite/dist/node/chunks/dep-e0f09032.js:61631:29)
      at async /Users/admin/projects/vue/fuckup/node_modules/vite/dist/node/chunks/dep-e0f09032.js:61739:32
12:53:31 [vite] Internal server error: <template functional> is no longer supported in Vue 3, since functional components no longer have significant performance difference from stateful ones. Just use a normal <template> instead.
  Plugin: vite:vue
  File: /Users/admin/projects/vue/fuckup/node_modules/vitepress-for-component/dist/client/theme-default/components/icons/OutboundLink.vue
      at /Users/admin/projects/vue/fuckup/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:196:37
      at Array.forEach (<anonymous>)
      at Object.parse (/Users/admin/projects/vue/fuckup/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:182:18)
      at createDescriptor (/Users/admin/projects/vue/fuckup/node_modules/@vitejs/plugin-vue/dist/index.js:4392:52)
      at transformMain (/Users/admin/projects/vue/fuckup/node_modules/@vitejs/plugin-vue/dist/index.js:4694:32)
      at TransformContext.transform (/Users/admin/projects/vue/fuckup/node_modules/@vitejs/plugin-vue/dist/index.js:5016:16)
      at Object.transform (/Users/admin/projects/vue/fuckup/node_modules/vite/dist/node/chunks/dep-e0f09032.js:46027:53)
      at async transformRequest (/Users/admin/projects/vue/fuckup/node_modules/vite/dist/node/chunks/dep-e0f09032.js:61631:29)
      at async /Users/admin/projects/vue/fuckup/node_modules/vite/dist/node/chunks/dep-e0f09032.js:61739:32

To Reproduce
Steps to reproduce the behavior:
see Describe the bug

Expected behavior
to, not to put too fine a point on it, work.

System Info

  • vitepress version: ?
  • vite version: ^2.0.1
  • Node version: v14.15.4
  • OS version: macOS 10.14.6

Additional context
nothing more.

引入docs目录外的组件会报错

docs目录下新建了一个文件夹叫demo,里面有一个demo.vue文件,通过./index.zh-CN.md引入demo,demo中引入了docs文件夹外的组件通过../../components/xxx/xxx.tsx,但运行起来报错,查看了.temp文件夹里的文件,目录结构不一致导致的,无法引入docs文件夹外的组件,需要重复复制代码到docs文件夹里

打包前后Css样式不一致问题

能不能把默认css样式也一同打包,我发现组件发布的样式和这个项目预览的不一样,例如,用这个文档会默认为table表格加一些样式,但是打包之后,样式没有了,看起来很不一致。而且我无法得知默认样式有哪些

升级之后

copy to .temp success.
failed to start server. error:
Error: Cannot find module '/Users/a123/Documents/My/libs/docs/.temp/.vitepress/config.js'
Require stack:

  • /Users/a123/Documents/My/libs/node_modules/vitepress-for-component/dist/node/config.js
  • /Users/a123/Documents/My/libs/node_modules/vitepress-for-component/dist/node/server.js
  • /Users/a123/Documents/My/libs/node_modules/vitepress-for-component/dist/node/index.js
  • /Users/a123/Documents/My/libs/node_modules/vitepress-for-component/dist/node/cli.js
  • /Users/a123/Documents/My/libs/node_modules/vitepress-for-component/bin/vitepress-fc.js

npm run dev之后报错

使用脚手架 yarn create vlib 初始化项目,然后npm run dev,之后报错Internal server error: is no longer supported in Vue 3, since functional components no longer have significant performance difference from stateful ones. Just use a normal instead.
image

是否有lerna

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

Expected behavior
A clear and concise description of what you expected to happen.

System Info

  • vitepress version:
  • vite version:
  • Node version:
  • OS version:

Additional context
Add any other context about the problem here.

将组件放入src的子级文件夹后无法正确渲染

Describe the bug
通过调整配置使工具能够编译src子目录下的组件文档,并在temp中生成了相关文档,但是在页面中访问时,无法展示正确内容。

To Reproduce

  1. 更改 docs\.vitepress\config.js配置更改后配置如下
const base = process.env.NODE_ENV === 'production' ? '/@/' : '';
const { resolve } = require('path');

module.exports = {
  title: 'UAAS平台',
  description: '项目文档',
  // 扫描srcIncludes里面的 *.md文件
  srcIncludes: ['src/components'],
  alias: {
    // 为了能在demo中正确的使用  import { X } from 'test'
    [`/@/`]: resolve('./src'),
  },
  base,
  themeConfig: {
    // logo: '../logo.svg',
    nav: [{ text: 'demo', link: '/math' }],
    lang: 'zh-CN',
    locales: {
      '/': {
        lang: 'zh-CN',
        title: 'UAAS平台',
        description: '项目文档',
        label: '中文',
        selectText: '语言',
        nav: [{ text: '指南', link: '/' }],
        sidebar: [
          { text: '介绍', link: '/' },
          { text: 'Button', link: '/components/button/' },
          { text: 'OrganizationSelect', link: '/OrganizationSelect/' },
        ],
      },
    },
    search: {
      searchMaxSuggestions: 10,
    },
    lastUpdated: true,
    prevLink: true,
    nextLink: true,
  },
};
  1. src\components下创建组件
    组件包含以下文件
demo.vue
index.vue
index.zh-CN.md
// src\components\OrganizationSelect\index.zh-CN.md
---
map:
  # 映射到docs的路径
  path: /OrganizationSelect
---

# OrganizationSelect 组织选择组件

用于筛选组织的多级树级组件

## 组织选择组件

### 基本用法

<demo src="./demo.vue"
  language="vue"
  title="基本用法"
  desc="点击切换。"> </demo>

## API

// ```ts
import OrganizationSelect from '/@/components/OrganizationSelect.vue';
// ```
  1. 编译后结果
// docs\.temp\OrganizationSelect\index.md
---
map:
  path: /OrganizationSelect
  realPath: src\components\OrganizationSelect\index.zh-CN.md // 自动生成路径页面显示404
  realPath: src\OrganizationSelect\index.zh-CN.md // 手动删除 \components 后页面能正常显示,但是demo.vue does not exist!
---

# OrganizationSelect 组织选择组件

用于筛选组织的多级树级组件

## 组织选择组件

### 基本用法

<demo src="./demo.vue"
  language="vue"
  title="基本用法"
  desc="点击切换。"> </demo>

## API

import OrganizationSelect from '/@/components/OrganizationSelect.vue';

Expected behavior
希望能支持在已有项目内进行文档开发,或支持在src例如src\components子级目录下的文档编译显示

System Info

  • vitepress version: "vitepress-for-component": "^0.17.1"
  • vite version: "vite": "^2.6.13"
  • Node version: v16.15.0
  • OS version: win11

Additional context
Add any other context about the problem here.

npm run dev 报错

关键代码: const decodedHtmlStr = computed(() => decodeURIComponent(props.htmlStr ?? ""));
报错信息: Uncaught SyntaxError: Unexpected token ?

能够支持代码可编辑吗?

现在代码能在页面上跑起来,但是要想编辑代码的话,需要跳转到codepen,如果能够在当前页面可以编辑代码,同时能看到效果,那就更好了。

样式不能自定义吗?

请问一下样式如何自定义,比如我想自定义绑定我外部的vue为layout,试了一下会报错

console show `[@vue/compiler-sfc] `defineProps is a compiler macro and no longer needs to be imported.`

Is your feature request related to a problem? Please describe.
i use this lib, it show me [@vue/compiler-sfc] defineProps is a compiler macro and no longer needs to be imported. in console

Describe the solution you'd like
see source, find .vue component use setup script, import defineProps from vue.
but the defineProps function is macro function.
so
just remove import { defineProps } from 'vue' with .vue file can resolve this warnning

Describe alternatives you've considered
remove import { defineProps } from 'vue to fix it

Additional context

dev时,<demo>的渲染时机过早

Describe the bug
dev 时,head中script还未完成加载,demo内组件的onMounted已经完成了执行

To Reproduce
Steps to reproduce the behavior:
第一步:在 docs/public 下创建 test.js

window.TEST_FN = () => {
  console.log(123)
}

第二步:在 .md 文件中引入该script

---
head:
  - - script
    - src: '/test.js'
---

第三步:在demo或某个组件的onMounted里执行:

  window.TEST_FN()

Expected behavior
期望:可以成功打印 123

System Info

  • vitepress-for-component: 0.16.5
  • vite: 2.6.14

样式没办法按需加载

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
多组件构建场景,

.
├── src
│   ├── button
│   │   ├── demo
│   │   └── button.vue.d.ts
│   └── index.d.ts
├── style.css
├── vfctest.es.js
└── vfctest.umd.js

多个组件的样式全部都被打进入style.css里面了

Describe the solution you'd like
A clear and concise description of what you want to happen.
需要单独构建es的文件夹,单独对文件进行构建,dumiesm:'babel'配置一样,
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
类似vant构建esm模块或者dumies
Additional context
Add any other context or screenshots about the feature request here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.