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

Solving #23 Issue in the checkbox component, it is not showing the code correctly and showing a error message #24

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

The-x-35
Copy link

Solving #23 Made the checkbox on by default in the checkbox component and remove the ref which was causing the error. I have tested the code and it works.
image

Copy link
Member

@jamesgeorge007 jamesgeorge007 left a comment

Choose a reason for hiding this comment

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

So, from the stack trace it can be observed that the error gets logged when Histoire processes the props where it treats the entries starting with on as events attaching the @ prefix and fails to extract the event name since there aren't any characters appearing after on in this case being a prop, ref.

We'd ideally want to rename the on prop and can use this opportunity to follow a two-way data binding approach (modelValue prop) leveraging the useVModel composable. We can keep the existing event name change set via options instead of the default update:modelValue convention.

You can refer to the existing components, that follow this convention. For instance, HoppSmartInput.

const inputText = useVModel(props, "modelValue", emit)

Since this PR is likely to introduce a breaking change, it'll be made to target the next branch once it is up.

Copy link
Member

Choose a reason for hiding this comment

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

Please remove these changes.

@jamesgeorge007
Copy link
Member

The HoppSmartToggle component is another candidate that can be tackled in case you're interested.

defineProps({
on: {
type: Boolean,
default: false,
},
})

@The-x-35
Copy link
Author

okay i will try and see what all i can do

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