Мой компонент
<template>
<div>Шапка</div>
</template>
<script>
import cookies from 'js-cookie'
export default {
name: 'navigation',
props: ['backend'],
data() {
return {
isLogin: !!cookies.get('user')
}
},
methods: {
login() {
this.$store.commit('global/showLoginModal', true)
},
search(e) {
var qs = e.target.value
if (qs === '') {
return false
}
this.$router.replace('/search/' + qs)
}
}
}
</script>
Нужно добавить в него
var searchBar = $(".search"),
searchInput = searchBar.find("input"),
searchToggleBtn = $(".search-toggle"),
searchParent = $("header_content");
searchInput.on("focus", function() {
searchBar.addClass("expanded")
}), searchInput.on("blur", function() {
$(this).val() || searchBar.removeClass("expanded")
}), searchToggleBtn.on("click", function() {
$(this).toggleClass("active"), searchParent.toggleClass("search"), searchBar.toggleClass("visible"), searchInput.focus()
});