0
Answered

Is there way to render this simple vue example?

Nicholas Hernandez 4 years ago in iPad updated by Alexander Blach (Developer) 4 years ago 3

Hello -

I have an example script that i am working on through a new course i am taking. I have attached the two files and when I select to preview in safari when in the index.html file it shows the actual text {{ sayHello() }} instead of the function listed in JavaScript.


app.js
index.html

Please let me know what I may be doing wrong or if it is not possible!

Thanks.

Nick

Answer

Answer
Answered

It looks like you need to include vue.js after the #app div. I changed the index.html file to this and it worked for me:


index.html


GOOD, I'M SATISFIED

Awesome, that works perfect! Thank you!

Satisfaction mark by Nicholas Hernandez 4 years ago
Under review

Hello,

sorry, but I'm not familiar with vue.js.

I've looked at the index.html file and it doesn't look like a complete HTML file to me (missing html, head, body tags). Also, the .html file does not reference the app.js file anywhere.

Hello Alexander -

I’ve updated the code to include those tags. The JavaScript file is in the same folder as the HTML file. For Vue, you only need the script tag to reference the url which is in the script tag. I added these two files into js fiddle and the page renders appropriately.


 index.html

app.js

Please let me know your thoughts.

Thanks,

Nick


Answer
Answered

It looks like you need to include vue.js after the #app div. I changed the index.html file to this and it worked for me:


index.html