New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

vue-duckform

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-duckform

VueJS package to render a JS Object as a Form (Radio buttons, Checkboxes, Text Input, Scale Slider and Calendar input). Compatible with Laravel Duckform API.

  • 1.1.9
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

vue-duckform

Render a JS Object as a Form. Compatible with Laravel Duckform API.

Demo

Live demo here.

How to install

npm install vue-duckform

Register on component, or register for global usage

import Vue from 'vue'
import Duckform from 'vue-duckform'

Vue.component('Duckform', Duckform)

Usage with JS data (check demo site for formData format)

<duckform :form-data="formData" v-model="form"></duckform>

const formData = {
  title: 'Form title',
  description: 'Form description',
  sections: [
    {
      title: 'Section title',
      description: 'Section description',
      questions: [
        {
          type: 'free_text', //free_text, single_select, multiselect, scale, date, integer
          required: true,
          text: "What's your name?",
          possible_answers: [{id: 'possible_answer_1'}]
        },
        ...
    },
    ...
  ]
}
<duckform :form-data-endpoint="/api/duckforms/myform" v-model="form"></duckform>

Props

NameType'sDefaultDescription
formDataObject{}Form data, check demo site for format
submitDataObject{}Form Submit data, this is data of a partially filled up form. Will be merged by vue-duckform to formData.
formDataEndpointstringnullEndpoint to GET form data (Laravel duckform package recommended).
submitIdNumber/StringnullID of a Form Submit to GET/PATCH/POST from "/submits/" before populating the form. This is used to retrieve a partially filled form stored in database (Laravel duckform package recommended).
disabledbooleanfalseForm inputs disabled
valueObject{}Form object to bind to.

Slots

NameDescription
loadingContent when API request is in progress
errorLoadingContent after a non 2xx response from any API endpoint.
completedContent after form is completed.

Events

NameParametersDescription
inputformFires after user input on any question.
saveformFires after user clicks on 'Continue' or 'Submit' buttons.

Keywords

FAQs

Package last updated on 18 Feb 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc