vue-usf-feedback-form
v1.0.0
Published
Simple contact form for Vue 2 (name, email, message)
Downloads
5
Readme
USF Simple Feedback Form
Simple contact form for Vue 2 (name, email, message)
Installation
Install vue-usf-feedback-form with npm
npm install vue-usf-feedback-form
or using yarn
yarn add vue-usf-feedback-form
optional: install uikit with npm
Browser
Include the script file, e.g.:
<meta name="recaptcha" content="my_recaptchs_site_key">
...
<script type="text/javascript" src="node_modules/vuejs/dist/vue.min.js"></script>
<script type="text/javascript" src="node_modules/vue-usf-feedback-form/dist/plugin.min.js"></script>
Module
import { FeedbackForm } from 'vue-usf-feedback-form';
export default {
name: "my-component"
components: {
FeedbackForm
},
data() {
return {
postRequest: `${process.env.VUE_APP_SERVICES_API_URL}/post-form`,
showErrorDetail: false,
rowsTextarea: 4
}
}
}
./main.js
import Vue from 'vue';
import { VueReCaptcha } from 'vue-usf-feedback-form';
Vue.use(VueReCaptcha, { siteKey: `${process.env.VUE_APP_CAPTCHA_SITE_KEY}` });
Using
Once installed, it can be used in a template as simply as:
<feedback-form
:postRequest="postRequest"
:showErrorDetail="showErrorDetail"
:rowsTextarea="rowsTextarea"
/>