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

Change the default no-options message #6352

Conversation

zak39
Copy link

@zak39 zak39 commented Jan 7, 2025

Inform developers that we can use a different default message when there are no options available.

Examples:

<NcSelect
	track-by="gid"
	label="displayName"
	:options="selectable"
	:loading="loading"
	@option:selected="add"
	@search="lookupGroups"
	@close="selectable=[]">
	<template #no-options>
		<span />
	</template>
</NcSelect>

Or:

<NcSelect
	track-by="gid"
	label="displayName"
	:options="selectable"
	:loading="loading"
	@option:selected="add"
	@search="lookupGroups"
	@close="selectable=[]">
	<template #no-options>
		<span>
			No groups
		</span>
	</template>
</NcSelect>

Inform developers that we can use a different default message when there are no options available.

Examples:

<NcSelect
	track-by="gid"
	label="displayName"
	:options="selectable"
	:loading="loading"
	@option:selected="add"
	@search="lookupGroups"
	@close="selectable=[]">
	<template #no-options>
		<span />
	</template>
</NcSelect>

Or:

<NcSelect
	track-by="gid"
	label="displayName"
	:options="selectable"
	:loading="loading"
	@option:selected="add"
	@search="lookupGroups"
	@close="selectable=[]">
	<template #no-options>
		<span>
			No groups
		</span>
	</template>
</NcSelect>

Signed-off-by: zak39 <[email protected]>
@zak39 zak39 force-pushed the doc/no-options-slot-usage-from-dependency branch from c47f8a3 to 5cf6528 Compare January 7, 2025 16:25
Copy link
Contributor

@ShGKme ShGKme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution.

Unfortunately, this change is not valid in vue-styleguidist.

And I don't think that there is a problem. Documentation already references to the wrapped component API with all the slots.

Comment on lines +552 to 558
<!--
@slot Define the message when there are no options available.
Default : "No results"
@see https://vue-select.org/guide/slots.html#improving-the-default-no-options-text
-->
{{ t('No results') }}
</template>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the vue-styleguidist docs, this is not correct usage of @slots. There is no <slot> element it describes here.

It doesn't change anything in the generated documentation

image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few lines below there is

<!-- @slot Any combination of slots from https://vue-select.org/api/slots.html -->

The only problem - vue-styleguidist takes variable name as a slot name, which might be not so obvious. But the text says "any of", and the link has the no-options slot as well as all the other slots.

@ShGKme
Copy link
Contributor

ShGKme commented Jan 17, 2025

Closing for now. Feel free to bump if you have further question/updates.

@ShGKme ShGKme closed this Jan 17, 2025
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