Skip to content

Instantly share code, notes, and snippets.

@vicgonvt
Created July 10, 2018 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vicgonvt/ef0d2153d0f812d162d6a3b7f908c649 to your computer and use it in GitHub Desktop.
Save vicgonvt/ef0d2153d0f812d162d6a3b7f908c649 to your computer and use it in GitHub Desktop.
<template>
<ul>
<result v-for="result in results" :key="result.id">
@{{ result.id }}
</result>
</ul>
</template>
<script>
export default {
data() {
return {
results: [
{id: 1, serial_no: 123},
{id: 2, serial_no: 234},
]
};
}
}
Vue.component('result', {
template: `<li><slot></slot></li>`,
});
new Vue({
el: "#app",
data: {
searchTerm: '',
results: [],
},
methods: {
search() {
console.log(this.searchTerm)
},
}
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment