0.7.2 • Published 2 years ago

@juno0424/vue2-hapi v0.7.2

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

HAPI Form Plugin For Vue 2

Installation

NPM

npm install @juno0424/vue2-hapi

Yarn

yarn add @juno0424/vue2-hapi

Usage

<template>
  <form @submit.prevent="submit">
    <div>
      <label>Name</label>
      <input type="text" v-model="fields.name" />
      <p v-if="errors && errors.name" v-text="errors.name[0]"></p>
    </div>
        <div>
      <label>Name</label>
      <input type="text" v-model="fields.name" />
      <p v-if="errors && errors.name" v-text="errors.name[0]"></p>
    </div>
    <div>
      <button type="submit">Submit</button>
      <p x-if="busy">Busy... please wait.</p>
    </div>
  </form>
</template>

<script>
import hapiMixins from "@juno0424/vue2-hapi";

export default {
  mixins: [hapiMixins],
  data() {
    return {
      endpoint: "http://localhost/api/c9a2eac4-9869-4641-913e-8e132e947229",
      redirectTo: "/thank-you"

      // or

      redirectTo: () => {
          // do something
      }
    };
  },
};
</script>

Busy state

You may make use of the this.busy state to bind attributes or display loading image to give better user experience.

Array fields

When you need array fields, please assign it on the the data() object accordingly.

Example:

<script>
export default {
  data() {
    return {
      fields: {
        colors: []
      }
    }
  }
}
</script>
0.7.2

2 years ago

0.7.1

3 years ago

0.6.2

3 years ago

0.7.0

3 years ago

0.6.1

3 years ago

0.6.0

3 years ago

0.5.0

3 years ago

0.4.0

3 years ago

0.3.4

3 years ago

0.3.0

3 years ago

0.3.2

3 years ago

0.3.1

3 years ago

0.3.3

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.2.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago