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

Radio buttons can't have numerical values #4

Closed
mstralka opened this issue Feb 14, 2018 · 2 comments
Closed

Radio buttons can't have numerical values #4

mstralka opened this issue Feb 14, 2018 · 2 comments

Comments

@mstralka
Copy link

I have a list of radio buttons that I want to render from this list of objects. Note that "id" values are integers:

const items = [
    {id: 1, name: 'Option 1'},
    {id: 2, name: 'Option 2'},
    {id: 3, name: 'Option 3'}
];

If I use the radio button tag:

<p-radio v-for="item in options"
         :key="item.id"
         class="p-default p-fill p-round"
         v-model="form.option"
         :value="item.id"
         color="success"
         required>
    {{ item.name }}
</p-radio>

I get this warning in the console:

[Vue warn]: Invalid prop: type check failed for prop "value". Expected String, got Number.

I think this is because the value prop on the PrettyInput.vue component is typed as a String.

Could the value prop be changed to accept String or Number, or just any value?

Or is there some other way I can use pass integer values to the radio button values?

Thanks
Mark

@hamed-ehtesham
Copy link
Owner

Hi @mstralka,

thank you for using this component and opening this issue to let me know of this problem

i fixed it and value can has any type now, please update to version 1.1.6

@mstralka
Copy link
Author

Awesome thanks for fixing it so quickly. This is a great component.

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

No branches or pull requests

2 participants