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

feat(resolvers/antdv.ts): customize prefix whatever you want #616

Merged
merged 5 commits into from Aug 8, 2023

Conversation

yuzheng14
Copy link
Contributor

Description

Add option.prefix in AntDesignVueResolver's paramater to decide how to resolve prefix.

If option.prefix is undefined, AntDesignVueResolver will perform as before. And if it is a string, it will resolve prefix as it pass.

Such as,

export default defineConfig(({ mode }) => {
  return {
    plugins: [
      Components({
        resolvers: [
          AntDesignVueResolver({
            prefix: '',
          }),
        ],
      }),
    ],
  },
}

Then we can use LayoutContent rather than ALayoutContent, and we can customize it as we want.

Why I do this

At the ant-design, which is the original version of antdv, we usually use form like LayoutContent rather than ALayoutContent to import the component. But AntDesignVueResolver only resolve form like ALayoutContent, so that I wirte this PR to make form like LayoutContent compatible by options.prefix.

Additional context

I test this in my protect and it perform perfectly.

@yuzheng14 yuzheng14 changed the title Feat/antdv custom prefix feat(resolvers/antdv.ts): customize prefix whatever you want Mar 13, 2023
@nabaonan nabaonan merged commit 929dfac into unplugin:main Aug 8, 2023
7 checks passed
sxzz added a commit that referenced this pull request Aug 30, 2023
Co-authored-by: yuzheng14 <422450117@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants