Skip to content

Commit

Permalink
Edit Components nayarahilton#1
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasjs committed Nov 26, 2017
1 parent 6de6c1a commit e1fe6ff
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions src/components/MainInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
:name="name"
:id="id"
:placeholder="placeholder"
:required="required"
:class="inputStyle"
class="input"
ref="input"
v-bind:value="value"
v-on:input="updateValue($event.target.value)"
/>
</template>

Expand All @@ -17,6 +19,9 @@ export default {
required: true,
type: String,
},
value: {
type: String,
},
name: {
type: String,
},
Expand All @@ -27,10 +32,6 @@ export default {
required: true,
type: String,
},
required: {
required: true,
type: Boolean,
},
design: {
type: String,
},
Expand All @@ -39,6 +40,12 @@ export default {
inputStyle() {
if (this.design === 'main' || !this.design) return 'input--main';
if (this.design === 'login') return 'input--login';
if (this.design === 'invalid') return 'input--invalid';
},
},
methods: {
updateValue(value) {
this.$emit('input', value);
},
},
};
Expand Down Expand Up @@ -70,4 +77,7 @@ export default {
border solid #fff
border-width: 0 0 1px 0;
color #fff
&--invalid
border-color red
</style>

0 comments on commit e1fe6ff

Please sign in to comment.