app-form-id.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <template>
  2. <view class="app-form-id">
  3. <form report-submit @submit="formSubmit">
  4. <button formType="submit" :style="{'color': color ? color : ''}" hover-class="none">
  5. <slot></slot>
  6. </button>
  7. </form>
  8. </view>
  9. </template>
  10. <script>
  11. import { push } from '../../../core/formId.js';
  12. export default {
  13. name: 'app-form-id',
  14. props: {
  15. color: String,
  16. item: Object,
  17. },
  18. methods: {
  19. formSubmit(e) {
  20. push(e.detail.formId);
  21. this.$emit('click', e, this.item);
  22. }
  23. }
  24. }
  25. </script>
  26. <style scoped lang="scss">
  27. form {
  28. display: block;
  29. height: 100%;
  30. width: 100%;
  31. }
  32. button {
  33. height: 100%;
  34. width: 100%;
  35. }
  36. button {
  37. display: block;
  38. line-height: inherit;
  39. text-align: inherit;
  40. padding: 0 0;
  41. background: transparent;
  42. border: none;
  43. border-radius: 0;
  44. overflow: inherit;
  45. font-size: inherit;
  46. color: inherit;
  47. }
  48. button:after {
  49. display: none;
  50. }
  51. button.button-hover {
  52. color: inherit;
  53. background-color: transparent;
  54. }
  55. .app-form-id {
  56. /* #ifndef MP-ALIPAY */
  57. height: 100%;
  58. /* #endif */
  59. /* #ifdef MP-ALIPAY */
  60. max-height: 100%;
  61. /* #endif */
  62. }
  63. </style>