Home > Web Front-end > JS Tutorial > body text

The use of methods and data attributes in Vuejs

藏色散人
Release: 2019-04-18 11:16:08
Original
10577 people have browsed it



In this article, we will introduce to you how to use methods and data attributes in Vue JS.

Note, we use Vue cli to generate the project.

Create our project

Let’s quickly create our vue project by running the following command.

vue create vue-app
Copy after login

The above command will download the required files in the vue-app folder.

Use cd vue-appChange the working directory, then open the project folder using your favorite code editor.

Navigate to the App.vue file in the src folder and delete all contents, then replace it with the code below.

App.vue

<template>
  <div>
    <h1>Hello Vuejs</h1>
  </div>
</template>

<script>
export default {};
</script>
Copy after login

<strong>data</strong>Properties

In the above code, we will export the default empty object inside the

Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template