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

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.

主站蜘蛛池模板: 锦屏县| 珲春市| 武夷山市| 德州市| 宁德市| 永嘉县| 明溪县| 海城市| 吉木乃县| 家居| 青川县| 荣昌县| 衡山县| 绥芬河市| 凉山| 延寿县| 海原县| 高陵县| 四会市| 井陉县| 北碚区| 江山市| 元朗区| 铜鼓县| 中卫市| 南召县| 永年县| 孝昌县| 长武县| 石狮市| 新丰县| 岫岩| 滁州市| 鹤山市| 安仁县| 云安县| 巍山| 固镇县| 张家界市| 凤山市| 铁岭市|