Feature Request: `displayName` as config to prefix display Name
See original GitHub issueThe problem
We can’t default prefix/suffix/mutate the displayName without setting @displayName
for each component, which is kinda useless (i guess) if using <script setup>
. In some scenarios my file is named Test.vue
but later it’s used like <my-lib-test>
.
Proposed solution
e.g. extend DocGenOptions
with:
options: DocGenOptions= {
displayName: (fileName, name, __name)=> `MyLib${name}`
}
Alternative solutions
Additional context
Current example setup:
-| src
--| components
----- Foo.vue
----- Bar.vue
----- index.ts
// index.ts
export {default as MyLibFoo} from './Foo.vue'
export {default as MyLibBar} from './Bar.vue'
// Library install function used like app.use(myLib)
function install(
app: App,
name: string,
component: ComponentType,
): void {
app.component('MyLib'+ name, component)
}
Components are registered and exported with prefix.
Issue Analytics
- State:
- Created a year ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Displayname issue #836 - Zrips/CMI - GitHub
Description of issue or feature request: Hello, i have added a plugin named : Powertags to be able to give player prefixes/suffixes. but...
Read more >CMake preset: use displayName in "Configuration" and "Build ...
This request is to use the displayName (when provided and not an empty string) in the drop down for “Configuration” and “Build Preset”...
Read more >directoryObject: validateProperties - Microsoft Graph v1.0
Validate that a Microsoft 365 group's display name or mail nickname complies with naming policies.
Read more >Display Name - Sitecore Idiosyncrasies
This blog post contains information about the concept of item display names in the Sitecore ASP.NET web Content Management System (CMS).
Read more >Tooling - styled-components
By default, the displayName of a component will be prefixed with the filename in order to make the component name as unique as...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Sorry to hear that. I hope it clears out soon.
I would reverse the order of the 2 arguments but I like this API a lot.