Just starting out with Vue and working on a web app. I have some data in the JavaScript that includes keys like title, author, etc. I'm looking to pass the value associated with the title key to Vue. How can I achieve this?
I attempted using book.title, but encountered an error in Vue.
<tbody>
<tr v-for="(row, index) in filteredRows" :key="`iSBN-${index}`">
<td v-html="highlightMatches(row.title)">{{ row.title }}</td>
<td>{{ row.author }}</td>
</tr>
</tbody>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>
<script>
var book = {{ query_results_book_json|safe}};
console.log(book);
const app = new Vue({
el: '#app',
data: {
filter:'',
rows: [
{ title: book.title, author: '' }
]
}
})
</script>