@burh/nuxt-core 1.0.203 → 1.0.204

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -28,23 +28,44 @@
28
28
  em contato.
29
29
  </p>
30
30
 
31
- <form>
32
- <input
33
- type="text"
34
- v-model="name"
35
- placeholder="Nome Completo"
36
- />
37
-
38
- <input
39
- type="text"
40
- v-model="phone"
41
- placeholder="Telefone"
42
- />
43
-
44
- <button type="button" @click="sendContact()">
45
- Solicitar Contato
46
- </button>
47
- </form>
31
+ <validation-observer ref="sendTest">
32
+ <section>
33
+ <validation-provider
34
+ tag="div"
35
+ name="Nome"
36
+ rules="required"
37
+ v-slot="{ errors }"
38
+ >
39
+ <base-input
40
+ type="text"
41
+ v-model="name"
42
+ :error="errors[0]"
43
+ :valid="errors.length ? true : false"
44
+ placeholder="Nome Completo"
45
+ />
46
+ </validation-provider>
47
+
48
+ <validation-provider
49
+ tag="div"
50
+ name="Telefone"
51
+ rules="required"
52
+ v-slot="{ errors }"
53
+ >
54
+ <base-input
55
+ type="text"
56
+ v-model="phone"
57
+ id="phone"
58
+ :error="errors[0]"
59
+ :valid="errors.length ? true : false"
60
+ placeholder="Telefone"
61
+ />
62
+ </validation-provider>
63
+
64
+ <button type="button" @click="sendContact()">
65
+ Solicitar Contato
66
+ </button>
67
+ </section>
68
+ </validation-observer>
48
69
  </section>
49
70
  </div>
50
71
  </div>
@@ -79,10 +100,14 @@ export default {
79
100
  };
80
101
  },
81
102
  methods: {
82
- sendContact() {
83
- if (this.name || this.phone) {
84
- this.$emit('send-contact', this.name, this.phone);
103
+ async sendContact() {
104
+ const pass = await this.$refs.sendTest.validate();
105
+ if (!pass) {
106
+ return;
85
107
  }
108
+
109
+ this.$emit('send-contact', this.name, this.phone);
110
+ this.$emit('close');
86
111
  }
87
112
  }
88
113
  };
@@ -172,7 +197,7 @@ export default {
172
197
  color: #1d364b;
173
198
  }
174
199
 
175
- form {
200
+ section {
176
201
  input {
177
202
  margin: 0.4rem 0;
178
203
  padding: 0.75rem;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burh/nuxt-core",
3
- "version": "1.0.203",
3
+ "version": "1.0.204",
4
4
  "description": "Design System and Components.",
5
5
  "author": "Burh",
6
6
  "scripts": {