Skip to content

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 requested a review from nabaonan as a code owner March 13, 2023 09:30
@yuzheng14 yuzheng14 changed the title Feat/antdv custom prefix feat(resolvers/antdv.ts): customize prefix whatever you want Mar 13, 2023
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.

2 participants