I'm trying to go through a basic vue tutorial. Recently I must have changed something that is stopping anything in the vue.js from rendering on my page and I can't seem to find out why. Example: instead of displaying the value of data.product, it displays {{ Product }}. Thanks in advance for any help!
Here's a link to the project repo on gitlab: project link
-
Hey there! I think you could improve this question by trying to provide any error messages from the dev tools, and maybe setup a codepen or something similar!Evan Bechtol– Evan Bechtol2019-03-02 05:31:49 +00:00Commented Mar 2, 2019 at 5:31
Add a comment
|
1 Answer
I'm quite sure you will see an Uncaught ReferenceError if you open the DevTools of your browser. Because in your main.js file you reference two times to non-existent variables. In your variants-array you are using Green and Blue for your variantColor as variables but non of them is defined. From context I guess you just want to display these two values as string at your page, so you have to assign a string to your variantColor variable by adding single or double quotes.
Inside your main.js change your variant array to this:
...
variants: [
{
variantId: 2234,
variantColor: 'Green'
},
{
variantId: 2235,
variantColor: 'Blue'
}
]
...