Computer scienceFrontendVue.jsVue 3 SyntaxVue Instance

Creating a Vue instance

Adding the code

Report a typo

In this task, we need to add the code to increase our counter by 1 each time when the method calls. This code should be within the incrementCount property. Choose the correct answer below.

<!DOCTYPE html>
<html>
<head>
  <title>My First Vue App</title>
</head>
<body>
  <div id="main">
    {{ counter }}
  </div>
  
  <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.global.min.js"></script>
  <script>
   const app = Vue.createApp({
      setup() {
        const state = reactive({
          count: 0
        });
        function incrementCount() {
          'missing string'
        }
      }
    });

    app.mount('#main');
  </script>
</body>
</html>
Select one option from the list

Create a free account to access the full topic