官术网_书友最值得收藏!

One-minute setup

Without further ado, let's start creating our first Vue app with a very quick setup. Vue is flexible enough to be included in any web page with a simple script tag. Let's create a very simple web page that includes the library, with a simple p element and another script tag:

<html>
<head>
<meta charset="utf-8">
<title>Vue Project Guide setup</title>
</head>
<body>

<!-- Include the library in the page -->
<script src="https://unpkg.com/vue/dist/vue.js"></script>

<!-- Some HTML -->
<p id="root">
<p>Is this an Hello world?</p>
</p>

<!-- Some JavaScript -->
<script>
console.log('Yes! We are using Vue version', Vue.version)
</script>

</body>
</html>

In the browser console, we should have something like this:

Yes! We are using Vue version 2.0.3

As you can see in the preceding code, the library exposes a Vue object that contains all the features we need to use it. We are now ready to go.

主站蜘蛛池模板: 洪泽县| 武平县| 大庆市| 三原县| 平和县| 衡阳市| 惠来县| 乌拉特前旗| 抚州市| 金川县| 卢龙县| 二连浩特市| 孟津县| 饶河县| 大田县| 肥乡县| 临泉县| 如东县| 宜阳县| 龙游县| 长葛市| 崇州市| 滕州市| 桐庐县| 丰镇市| 乌鲁木齐县| 平陆县| 融水| 蒙山县| 吉安县| 治县。| 密山市| 武定县| 永修县| 孟村| 莱西市| 兰坪| 电白县| 收藏| 安福县| 剑川县|