Created
July 10, 2018 14:22
-
-
Save vicgonvt/ef0d2153d0f812d162d6a3b7f908c649 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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