Languages
[Edit]
EN

Vue.js - use Vue in HTML web page (.html file)

0 points
Created by:
p_agon
589

In this article, we would like to show you how to use Vue.js in HTML web page.

Step by step

Edit

1. In your .html file, you need to attach the following <script> tag to use Vue.js via CDN:

Note:

In References section below, you can find link to the official documentation with the latest version of CDN.

2. Create HTML element with id="app" that will be a representation of Vue.js application:

3. Create a <script> tag inside web page body and import createApp from Vue.

4. Inside the <script> , use createApp to create Vue application and mount it to the #app element.

Practical example

Edit

In this example, we present how to bind Vue.js to the HTML element and display some message stored as the Vue object data.

 

References

Edit
  1. Quick Start | Vue.js

Alternative titles

  1. Vue.js - use Vue in .html file
  2. Vue.js - attach Vue to HTML web page using CDN
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join