when using the following code: https://github.com/iamshaunjp/vuejs-playlist/blob/lesson-18/src/App.vue
My browser displays function () { [native code] }
where it should display “heeey cowboy”.
Any idea what’s going on? I’m working from the tutorial here, using the CLI, and everything is identical to the provided files.
Answer
You forgot the parenthesis mate:
<template> <div> <h1>{{ title }}</h1> <p>{{ greeting() }}</p> </div> </template>
The error is in greeting
, you forgot to add these parenthesis after it ()
, that’s how you call a javascript function