FormWrapper.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <template>
  2. <div class="columns is-centered">
  3. <div class="form-column column is-two-thirds-tablet is-half-desktop is-one-third-widescreen is-one-quarter-fullhd">
  4. <h1 class="title" v-html="title" v-if="title"></h1>
  5. <slot />
  6. <p v-if="showTag">
  7. <notification :message="fail" type="is-danger" isFixed="hasFixedNotification" v-if="fail" />
  8. <notification :message="success" type="is-success" isFixed="hasFixedNotification" v-if="success" />
  9. </p>
  10. </div>
  11. </div>
  12. </template>
  13. <script>
  14. export default {
  15. name: 'FormWrapper',
  16. data() {
  17. return {
  18. }
  19. },
  20. computed: {
  21. showTag: function() {
  22. return (this.fail || this.success) ? true : false
  23. }
  24. },
  25. props: {
  26. title: {
  27. type: String,
  28. default: ''
  29. },
  30. fail: {
  31. type: String,
  32. default: ''
  33. },
  34. success: {
  35. type: String,
  36. default: ''
  37. },
  38. hasFixedNotification: {
  39. type: Boolean,
  40. default: false
  41. },
  42. }
  43. }
  44. </script>