New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

nast-form

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nast-form

Library for manage forms.

latest
Source
npmnpm
Version
1.0.5
Version published
Maintainers
1
Created
Source

nast-form

Installation

npm i -S nast-form

Prepare

import Vue from 'vue'
import App from './App'
import NastForm from 'nast-form'

Vue.use(NastForm.vue(), {})

new Vue({
  render: (h) => h(App),
}).$mount('#app')

Basic usage

<div id="app">
<form @submit.prevent="submit">
  {{ $form.errors() }}
  <div><input title="Name" :v-bind="$form.input('name')" @input="($event) => change($event, 'name')" /></div>
  <div><input title="Email" :v-bind="$form.input('email')" @input="($event) => change($event, 'email')" /></div>
  <div><button type="submit">Submit</button></div>
</form>
</div>

export default {
  name: 'App',
  mounted() {
    this.$form.init({
      name: '',
      email: '',
    })
    this.$form.rules({
      name: [ 'required', ],
      email: [ 'email', ],
    })
  },
  methods: {
    change(event, name) {
      this.$form.set(name, event.target.value)
    },
    submit() {
      if (this.$form.check()) {
        console.log(this.$form.get())
      }
    },
  },
}

Keywords

vue

FAQs

Package last updated on 05 Aug 2021

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