DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Data Engineering
  3. Data
  4. Display Data with Vue.js

Display Data with Vue.js

Here is the first lesson on Vue.js shows how to use Vue objects.

Paul Underwood user avatar by
Paul Underwood
·
Oct. 26, 16 · Tutorial
Like (11)
Save
Tweet
Share
19.41K Views

Join the DZone community and get the full member experience.

Join For Free

This is the first post from the learning Vue.js series, you can see all the code examples in this series on the following GitHub repository. Vue Examples.

The first thing you need to learn with VueJS is how you can use the Vue Object inside your application.

To get started all you need to do is include the following JavaScript.

<script src="https://unpkg.com/vue/dist/vue.js"></script>

Now you have access the Vue object in your application.

<script>
    var app = new Vue({
        el: '#app',
        data: {
            message: 'Hello World!'
        }
    })
</script>

The code above creates a Vue object and uses the element with ID of app. Then it has a data property which has a message key with a value Hello World.

With the data property of message we can now use this with the application by using the handlebars syntax.

{{ message }}

Using the handlebar syntax for message will print the contents of message which is Hello World!.

Reactive

VueJS links the data and the DOM together which makes the code and the page reactive, so if you change the data the page will automatically update. You can see this happening by opening up your browser console and typing app.message, which will print Hello World! in your console as it matches the data property in Vue.

To see the reactive working in VueJS you can open your console and change the message value.

app.message = 'New text'

When you hit enter you'll see the new value of app.message in the console and you'll also see Hello World on the page text is now changed to New text.

View the demo page to see this in action.

Data (computing) Vue.js

Published at DZone with permission of Paul Underwood, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • DevOps Roadmap for 2022
  • Core Machine Learning Metrics
  • PostgreSQL: Bulk Loading Data With Node.js and Sequelize
  • Java Development Trends 2023

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: