Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

文档补充,组件引入相关增加代码片段示例 #643

Closed
ocean-gao opened this issue Feb 28, 2024 · 0 comments · Fixed by #750
Closed

文档补充,组件引入相关增加代码片段示例 #643

ocean-gao opened this issue Feb 28, 2024 · 0 comments · Fixed by #750
Labels
enhancement New feature or request

Comments

@ocean-gao
Copy link
Collaborator

相关的问题

image

全局部分引入:

import { FButton } from '@fesjs/fes-design';
app.use(FButton);

全局完整引入:

import FesDesign from '@fesjs/fes-design'
app.use(FesDesign)

按需引入:

以Vite为例。

// vite.config.ts

import Components from 'unplugin-vue-components/vite';

export default defineConfig({
  // ...
  plugins: [
    Components({
     resolvers: [
        (componentName) => {
            if (componentName.match(/^(F[A-Z]|f-[a-z])/))
                return {
                    name: componentName,
                    from: '@fesjs/fes-design',
                };
        },
    }),
  ],
})

手动导入:

<template>
  <FButton>我是 FButton</FButton>
</template>
<script>
  import { FButton } from '@fesjs/fes-design'
  export default {
    components: { FButton },
  }
</script>

解决方案

No response

考虑过的替代方案

No response

其它补充内容

No response

@ocean-gao ocean-gao added the enhancement New feature or request label Feb 28, 2024
@ocean-gao ocean-gao assigned ocean-gao and unassigned ocean-gao Mar 14, 2024
@1zumii 1zumii linked a pull request Apr 19, 2024 that will close this issue
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant