Sha256: 5d481b84045660ed6c7c506606a9e420f4e0ae35d69f57fb5a808fc88ca3473d
Contents?: true
Size: 1.56 KB
Versions: 18
Compression:
Stored size: 1.56 KB
Contents
// Optional Javascript callback class. You typically need to define this when you have data to submit, or special // event handling to bind to. // To hook this up you need to provide the `v-plugin` class and // data-plugin-callback='RandomFacts' on the element. class RandomFacts { // passed the DOM element that has the .v-plugin class on it. constructor(element) { // This is where you might pull data elements into your // component from the markup. Like so: // this.data = element.dataset.someDataICareAbout; } // Optional // Called before the component is submitted via post/put. Allows the component to add its key/value pairs to the // submitted data. // If you provide this you need to add the v-input class to your DOM element to get called. // Containers iterate their elements that have the v-input class defined on them and invoke the prepareSubmit // function for each. prepareSubmit(params) { // params is a key,value pair. Add name/value like so: // params.push(['some_name', 'some_value']); } // Optional // Called whenever a container is about to be submitted, before prepareSubmit. // returns true on success // returns on failure return an error object that can be processed by VErrors: // { email: ["email must be filled", "email must be from your domain"] } // { page: ["must be filled"] } // Returning an error stops the submission. validate(formData) { return true; } // Optional // Clear's the control clear() { } }
Version data entries
18 entries across 18 versions & 2 rubygems