A Vue.js component that displays a call to action form button, and manages the state of the button.
npm install --save-dev vue-cta-button
Include the script file, then install the component with Vue.use(CtaButton);
e.g.:
<script type="text/javascript" src="node_modules/vuejs/dist/vue.min.js"></script>
<script type="text/javascript" src="node_modules/vue-cta-button/dist/vue-cta-button.min.js"></script>
<script type="text/javascript">
Vue.use(CtaButton);
</script>
import CtaButton from 'vue-cta-button';
Once installed, it can be used in a template as simply as:
<vue-cta-button
type="submit"
v-bind:loading="isLoading"
text="Enter Now"
loadingText="<i class='fa fa-circle-o-notch fa-spin fa-fw'></i> Submitting..."
class="btn btn-primary"
>
</vue-cta-button>