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

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.

主站蜘蛛池模板: 长岛县| 林州市| 晋城| 丰顺县| 八宿县| 子长县| 新兴县| 定结县| 岳普湖县| 栾城县| 左贡县| 忻城县| 安达市| 亳州市| 宁晋县| 赤城县| 塘沽区| 临高县| 濉溪县| 甘泉县| 元氏县| 阳信县| 施甸县| 漳浦县| 吉木萨尔县| 郓城县| 静宁县| 鄢陵县| 武清区| 江华| 龙南县| 寻甸| 新宁县| 威远县| 泸水县| 宕昌县| 策勒县| 巴南区| 江口县| 蓬莱市| 嵊州市|