R
R
Rishat Sultanov2017-08-26 13:09:58
JavaScript
Rishat Sultanov, 2017-08-26 13:09:58

How to solve the problem with the visibility of data in an array in Vue JS?

Hello!
I started watching a course on Vue JS on Laracast and immediately fell into a syntax stupor.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Vue JS Learn</title>
</head>
<body>
    <div id="root" >
        <input type="text" id="input" v-model="message">
    </div>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.4.2/vue.min.js"></script>

    <script type="text/javascript">
        new Vue({
            el: '#root',
            date: {
                message: "Hello World"
            }
        })
    </script>
</body>
</html>

Error:
ReferenceError: message is not defined
Is the syntax of Vue JS 2.1.3 (Laracast) and Vue JS 2.4.2 (Mine) changed so minor?
Or did I make a mistake somewhere in the code?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Shashenkov, 2017-08-26
@rishatss

What is date , change to data

date: {
  message: "Hello World"
}

Change to
data: {
  message: "Hello World"
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question