[Vuejs]-Vue double curly braces to print/echo an input search term

0👍

you can store it as a variable

<template>
  <SearchBar @emitTermSearch="onTermSearch"></SearchBar>
  {{searchVal}}
</template>

<script>
import SearchBar from "./components/SearchBar";
export default {
  name: "App",
  components: {
    SearchBar
  },
  data():{
    return{
      searchVal: null
    }
  },
  methods: {
    onTermSearch(emitTermSearch) {
      this.searchVal = emitTermSearch;
    }
  }
};
</script>

Leave a comment