Made Search tile functionality, and filter component

This commit is contained in:
Alicia Sykes 2019-08-20 00:04:56 +01:00
parent 4e9f436972
commit 7623d4be5b
1 changed files with 45 additions and 10 deletions

View File

@ -1,11 +1,12 @@
<template>
<div>
<el-input
placeholder="Start typing station name or code"
v-model="input"
v-on:input="userIsTypingSomething">
</el-input>
</div>
<section>
<label for="filter-tiles">Search</label>
<input
id="filter-tiles"
v-model="input"
placeholder="Start typing to filter tiles..."
v-on:input="userIsTypingSomething" />
</section>
</template>
<script>
@ -18,14 +19,48 @@ export default {
}
},
methods: {
userIsTypingSomething (stuff) {
this.$emit('user-is-searchin', stuff)
userIsTypingSomething () {
this.$emit('user-is-searchin', this.input)
}
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="scss">
section {
display: flex;
align-items: center;
margin: 0.25em;
border-radius: 5px;
border: 1px solid transparent;
border: 1px solid #30556469;
-webkit-box-shadow: 1px 1px 2px #130f23;
box-shadow: 1px 1px 2px #130f23;
}
label {
display: inline;
background: -webkit-gradient(linear, right bottom, left top, from(#9F86FF), color-stop(#1CA8DD), to(#007AE1));
background: linear-gradient(to left top, #9F86FF, #1CA8DD, #007AE1);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
margin: 0.5em;
display: inline;
}
input {
display: inline-block;
width: 200px;
padding: 0.5em;
margin: 0.5em;
outline: none;
border: none;
border-radius: 5px;
background: #607d8b33;
box-shadow: 1px 1px 2px #232323;
color: #1CA8DD;
font-family: 'Comfortaa', cursive;
&:focus {
background: #607d8b4a;
}
}
</style>