Footer Search
- введен какой текст для поискаHeader Search
- как очищать поле с текстом в компоненте Footer Search
, кроме текущего? // Header/Footer
async searchData() {
this.$emit("input", {data: this.searchCards, ref: 'header'});
},
// App
methods: {
searchData({data, ref}) {
this.search = data;
this.resetInputs(ref)
},
resetInputs(ref) {
const refs = ['header', 'footer'],
refsToReset = refs.filter(e => e !== ref)
refsToReset.forEach(e => this.$refs[e].searchCards = '')
}
}