Uni Köln

Get started

Vue.js can be set up in a few different ways. We will use the one which transitions easily from the basic page structure from previous sections.

  1. Insert the script tag to include Vue.js just before your own script.

  2. Add the #app element. This will contain the HTML structure of the Vue.js app.

  3. Add the code to script.js.


The createApp method is provided by Vue.js. It sets up a new app, which is then connected to a HTML element using mount.

The app contains some data, which in this case has the property message. All properties from the data object are available inside of the app element.

In the HTML file the message property from the data is displayed using the curly braces notation. This instructs Vue.js to display the content of the variable instead of the literal text “message”.


    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <div id="app">{{ message }}</div>
    <script src=""></script>
    <script src="script.js"></script>


const { createApp, ref } = Vue

    data () {
        return {
            message: 'wwwow!'