2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 15:50:56 +00:00
books/ui/components/Navbar.vue

33 lines
799 B
Vue
Raw Normal View History

2018-06-27 14:38:27 +00:00
<template>
2018-07-12 15:17:46 +00:00
<nav class="frappe-navbar navbar navbar-light bg-light row no-gutters border-bottom border-top">
<form v-if="showSearch" class="form-inline col-4 pr-3">
<input type="text"
v-model="searchValue"
@input="updateSearch"
name="search"
class="form-control shadow-none w-100"
placeholder="Search...">
</form>
<div class="navbar-text">HI</div>
</nav>
2018-06-27 14:38:27 +00:00
</template>
2018-07-12 15:17:46 +00:00
<script>
import { debounce } from 'lodash';
export default {
props: ["showSearch"],
data() {
return {
searchValue: ''
};
},
mounted() {
this.$root.$on('newList', () => this.searchValue = '')
},
methods: {
updateSearch: debounce(function() {
this.$root.$emit("search", this.searchValue);
}, 500)
}
};
</script>