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

Unable to use v-binded values for data-* #9

Closed
Phunky opened this issue Sep 1, 2016 · 7 comments
Closed

Unable to use v-binded values for data-* #9

Phunky opened this issue Sep 1, 2016 · 7 comments

Comments

@Phunky
Copy link

Phunky commented Sep 1, 2016

Due to the use of this.el.dataset instead of directive params it is not possible to use v-bind values for these attributes.

The below does not currently work;

<input v-validate="value" v-model="value" :type='type' :name='name' :placeholder='placeholder' :modifiers='modifiers' :has="has" class="input" :data-rules="rules" :data-as="name">

@logaretm
Copy link
Owner

logaretm commented Sep 1, 2016

Well Vue 2.0 removes directive params, so I had to use dataset as recommended by the VueJS documentation and also mainly because I didn't want to be any differences between the v1 and v2 dists.

I believe it does not work because the validator only evaluates the dataset once it was bound by the directive.

may I ask if those bound values are only for rendering purposes (don't change)? or are they subject to change at any moment? I might be able to come up with a solution if its the first case.

@Phunky
Copy link
Author

Phunky commented Sep 1, 2016

Currently no expectation for them to change once rendered, just required as part of a <ui-input/> component.

I need to read up on directive changes for Vue2 as I was unaware of the deprecation of directive params.

@logaretm
Copy link
Owner

logaretm commented Sep 1, 2016

OK I might be able to do something about it. I will test few things and will get back to you later today or tomorrow.

meanwhile here is a couple of links for Vue 2.0:

vuejs/vue#2873
http://rc.vuejs.org/guide/custom-directive.html

@logaretm
Copy link
Owner

logaretm commented Sep 2, 2016

@Phunky Do you mind testing the latest commit? I tested few stuff and it appears its not happening with Vue 2.0.

Vue 1.0 seems to have this issue, I've delayed the binding until the next tick which should have your bindings ready by then. I might change few things until the next v1 tag.

@logaretm
Copy link
Owner

logaretm commented Sep 3, 2016

I believe its fixed in the latest v1.x now. Feel free to re-open this issue or create a new one if this is not the case.

@logaretm logaretm closed this as completed Sep 3, 2016
@Phunky
Copy link
Author

Phunky commented Sep 3, 2016

Hey @logaretm, just gave latest release a test and it's working 👍

@logaretm
Copy link
Owner

logaretm commented Sep 4, 2016

glad to hear, thanks for pointing this issue out.

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