janiskelemen/formvuelar

Errors

nikoz84 opened this issue · 3 comments

Hi. first that all thanks for the plugin.

i'm have a problem with this function hasErrors:

TypeError: **_vm.$parent.hasErrors** is not a function at Proxy.FvlSearchSelectvue_type_template_id_18b3ecd3_render (app.js:32391) at VueComponent.Vue._render (app.js:146950) at VueComponent.updateComponent (app.js:147466) at Watcher.get (app.js:147877) at new Watcher (app.js:147866) at mountComponent (app.js:147473) at VueComponent../node_modules/vue/dist/vue.common.dev.js.Vue.$mount (app.js:152443) at VueComponent../node_modules/vue/dist/vue.common.dev.js.Vue.$mount (app.js:155328) at init (app.js:146530) at createComponent (app.js:149372)

just import a component FvlSearchSelect

import { FvlSearchSelect } from "formvuelar";

<FvlSearchSelect :option-key="'id'" :option-value="'title'" :searchKeys="['id', 'title']" :name="'tags'" :options="[{title:'titulo1',id:15},{title:'titulo2',id:1}]"/>

how can i fix this issue?

Hi,

You always have to wrap the the components with the form component:

<fvl-form :data="form" url="/select">
<FvlSearchSelect :option-key="'id'" :option-value="'title'" :searchKeys="['id', 'title']" :name="'tags'" :options="[{title:'titulo1',id:15},{title:'titulo2',id:1}]"/>

</fvl-form>

Look at the example: https://github.com/janiskelemen/formvuelar/blob/master/src/examples/selects/SearchSelect.vue

ok thanks!!

Hi Janis,

How would you suggest making this work with subcomponents? I'm running into this issue and I don't want an fvl-form component around my child-component (I don't want a form inside a form):

<template>
    <fvl-form>
        <fvl-input />
        <child-component />
    </fvl-form>
</template

ChildComponent.vue:

<template>
    <fvl-input />
</template>