opened
justanne
username_0
Hello, still a learner here. I'm using Vue 1.0 and got a code where within a `for` loop (parent component) resides a radio input component that generates dynamic `name` appending numbers at the end for every increment: e.g. `radio_1`, `radio_2`, and so on - via `computed` property.

The `for` loop enables the user to dynamically add/remove the components on the form. So when I click the add button, the radio component adds on the form. This works well prior to validation.

Implementing the validation inside this loop however produces errors in the console and the components doesn't add:

`
vue.js:1141 [Vue warn]: Unknown custom element: <input-toggler> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
`

Inspecting the code, the `name` doesn't auto-update.

The radio input looks like this:

```
<input type="radio" :name="dp_name" :value="opt1" v-validate data-rules="required|in: {{ opt1 }},{{ opt2 }}">{{ opt1 }}</label>

<input type="radio" :name="dp_name" :value="opt2">{{ opt2 }}</label>
```

via

```
<input-toggler
    name="radio_"
    opt1="yes"
    opt2="no">
</input-toggler>
```

Outside this loop, the radio comp is working well, validating them with `.$broadcast`.

Any workaround/fix/support for this?
Dynamic component
issue
created
logaretm
username_1
Can you create a fiddle for this? So I can test out few stuff, thanks!
comment
created
justanne
username_0
I have yet to check why the `name` isn't working on my source while the basic fiddle does hmn. Here it is: https://jsfiddle.net/azj97xn9/
comment
created
justanne
username_0
Finally figured it out! Can't believe it was just this simple: moving the `Vue.use(VeeValidate);` on top before everything. My setup was each component file were compiled with the main `new Vue` file at the bottom most. So I have to move the `VeeValidate` on the first called component. All the warnings and errors disappeared and validation worked. 

Thanks for looking into this!
comment
closed
justanne
username_0
issue
created
logaretm
username_1
Sorry I couldn't help, but I'm glad it worked. I normally install vue plugins as soon as possible before registering any components to avoid these kind of issues.
comment