L
L
lillianfisher2021-04-22 07:20:30
Vue.js
lillianfisher, 2021-04-22 07:20:30

Why doesn't v-for work?

Hello, please tell me how to fix the code

<!DOCTYPE html>

<head>
  <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script>
</head>

<body>
  <div v-for="n in 10">{{ n }} </div>
</body>

</html>

According to the documentation https://ru.vuejs.org/v2/guide/list.html#v-for-%D0%... this should work...

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Artem, 2021-04-22
@lillianfisher

Probably because you did not specify anything in the script tag except for the included vue.js? :))
You just don't have a Vue instance))) I propose to return to the "Hello World" output, there you will see what the error is.

B
bqio, 2021-04-22
@bqio

You didn't specify the container that Vue will use.
https://vuejs.org/v2/guide/#declarative-rendering

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question