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

The quickest way to start using Vue2

In the last decade, a lot of the tools for web development have moved to the web, so let's go with the flow and start a new pen on http://codepen.io/.

You don't have to be a member of https://codepen.io/ to create pens there—you can just save them with the blanket username  Captain Anonymous . However, it's better to open an account so you have all your experiments in one plac e.

Once you navigate your browser to https://codepen.io, you'll be greeted with the following screen:

Click on the Create dropdown (in the main navigation, in the top-right area of the screen), and then click New Pen. Once you do, you will see the default editor setup:

Next, click the Settings button in the top right of the screen, and in the popup that appears choose JavaScript:

Next, in the Quick-add drop-down field, select the Vue option. Once you do, the first input will be filled out with the current minified version of Vue which is served from the Cloudflare CDN, or, more specifically, from this link: https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.13/vue.min.js.

That's it! We're ready to start using Vue2 in our Codepen project.

One thing to understand about Vue is that it makes our HTML dynamic. This is achieved by adding mustache syntax. This syntax is very easy to understand. We simply insert it inside an HTML element. For example, we can add mustache syntax to an h1 tag like this:

<h1>{{ heading1 }}</h1>

So, let's go over how this works in detail. Feel free to work on your own pen or see the example here: https://codepen.io/AjdinImsirovic/pen/rKYyvE.

主站蜘蛛池模板: 富蕴县| 黑龙江省| 福泉市| 从江县| 临邑县| 灵石县| 广水市| 油尖旺区| 达州市| 黄大仙区| 亚东县| 呼图壁县| 衢州市| 沭阳县| 文山县| 威宁| 沧州市| 唐海县| 杭锦后旗| 宁波市| 读书| 临西县| 读书| 秀山| 沐川县| 宁河县| 蚌埠市| 馆陶县| 渑池县| 涡阳县| 鹿泉市| 长顺县| 昭觉县| 肥西县| 理塘县| 门源| 沙坪坝区| 麻栗坡县| 济南市| 比如县| 江城|