Vue 3 Composition API reuse in multiple components
问题 I have these files App.vue, Header.vue, search.js and Search.vue App.vue is normal and just adding different views Header.vue has an input box <input type="text" v-model="searchPin" @keyup="searchResults" /> <div>{{searchPin}}</div> and script: import useSearch from "@/compositions/search"; export default { name: "Header", setup() { const { searchPin, searchResults } = useSearch(); return { searchPin, searchResults }; } }; search.js has the reusable code import { ref } from "vue"; export