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

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.

主站蜘蛛池模板: 冷水江市| 遂川县| 邓州市| 石嘴山市| 辉县市| 南川市| 扶沟县| 常熟市| 威远县| 巫山县| 南陵县| 武威市| 始兴县| 宁武县| 合作市| 尼木县| 崇信县| 慈溪市| 会东县| 夏河县| 日喀则市| 恩施市| 九龙城区| 老河口市| 凤山县| 江都市| 蕉岭县| 静海县| 房产| 中江县| 来宾市| 永安市| 丹巴县| 金昌市| 犍为县| 平乡县| 茌平县| 高要市| 克拉玛依市| 宁武县| 错那县|