matfish2 / vue-formular Goto Github PK
View Code? Open in Web Editor NEWa comprehensive vue.js form component
Home Page: https://www.npmjs.com/package/vue-formular
License: MIT License
a comprehensive vue.js form component
Home Page: https://www.npmjs.com/package/vue-formular
License: MIT License
I can't find a possibility to inject errors into the form when using client
. Is there some possibility to call sth like form.setErrors([{name: 'foo', message: 'bar'}])
or add an errors
prop to vf-form/vf-field?
If not is it possible to add this functionality?
Now I want to use a V-select without a placeholder . And I found that it will add a selectoption as default , but it will give the user update a empty value . How can I forbidden this default option ?
Hi I wish to know, how can I reset one form. For example, I have a modal form. When I close the form modal it's supposed to reset all fields. But when I reset the fields values, the errors (required) keep showing on. By the way I really loved your component, it's really clean when compared to the other I was using (vue-validator)
Great plugin, I use it with pleasure :)
Can you help me with one problem?
Is there a event which fires, when form hasErrors property is changed? I want to bind reactively to this property, so I can change accordingly one property of the parent element.
I have this structure:
<parent>
<child>
<vue-formular>
To achieve this I tried to create computed property in parent element
computed: {
isValid: !this.$refs.form.hasErrors
}
but recieve this error :
Cannot read property '$refs' of undefined
When I do this with getter funtion it seems to work, until I try to bind this property to other child element
<child :valid="isValid">
and then this error is coming:
[Vue warn]: Error when evaluating expression "function get() {
return this.$refs.form.hasErrors;
} Cannot read property 'hasErrors' of undefined
I tried to use watcher insteed, but with same errors.
Is it posible to bind to hasError property?
Hi,
if i use a Component for rendering form elements in a <vf-form>
it is not submitted when i send the form.
when I want to add the attribute disabled to a v-date , it can still be a white blank . No matter I set it by html or js ,it might give the user a wrong info . Is there a way to change the css ?
when I try to use vue-formular with webpack I get warnings in the npm run console and the browser (chrome) also just displays a white page and an error in the console
WARNING in ./~/vue-formular/lib/helpers/render-template.js
Critical dependencies:
2:0-7 require function is used in a way in which dependencies cannot be statically extracted
@ ./~/vue-formular/lib/helpers/render-template.js 2:0-7
WARNING in ./~/vue-formular/lib/helpers/render-template.js
Critical dependencies:
8:16-28 the request of a dependency is an expression
@ ./~/vue-formular/lib/helpers/render-template.js 8:16-28
WARNING in ./~/vue-formular/lib/components/methods/validate.js
Critical dependencies:
1:16-23 require function is used in a way in which dependencies cannot be statically extracted
@ ./~/vue-formular/lib/components/methods/validate.js 1:16-23
render-template.js?7dd7:2 Uncaught SyntaxError: Unexpected token !
# use default webpack template by vue-cli
vue init webpack testformular
# install stuff
cd testformular
npm install
# install vue-formular
npm i -D vue-formular
# edit src/main.js to enable vue-formular (see below)
# run dev server
npm run dev
Edit src/main.js
and add this:
import VueFormular from 'vue-formular'
Vue.use(VueFormular)
Can you give me a hint how to fix this?
Hi,
I am not sure if this is something I am doing wrong but the value returned by the v-select with the version of formular i am running returns the value of the "text" of the option instead of the id
when I copied some of my code into the demo fiddle, it returns the id correctly when i log the changed event.
what is the version of vue and vue-formular on the fiddle ?
I want to add a check to make sure user will save before exit.
And I found that there is a vue-formular.change event might be useful , but i can't use it as a common VUE
event .Is there any samples to use a event ?
I didn't find how to add type="hidden"
fields so i used additionalPayload
but it seems it doesn't respect the change. Submits the initial value options: {additionalPayload: {additional: 'initial value' }}
If i change it in a method this.options.additionalPayload.additional = 'asdsasds'
it submits 'inital value'
Also tried with this.$set('options.additionalPayload', {additional: 'asdasdasd'}
Hi
Thanks for this component. Love the ease of use.
But how do you integrate it with v-model ?
Cheers, rk
When in /items/new after submit i want to redirect to /items/:id so i used 'vue-formular.sent' event but after dispatching it tries to set some properties (vm.status = 'success'; ...etc) on the now not existing instance which leads to error. Any suggestions?
It would be nice to have a possibility to trigger focus() on a field after instantiating/showing it.
For example:
Either through a autofocus
property that triggers this.field.focus()
on ready
or
somehow expose the field or the focus function so I can trigger the focus() event from the component in which I'm using the vf-field.
Hi
I have a question. I would like to disable the submit button on a form if the form has errors. But i would like to do it based on a computed field which looks at the field and also a values of a few other fields and then indicates whether the submit button should be enabled
computed: {
canSubmit: function() {
// how do i check here whether form has validation errors based on rules defined for fields ?
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.