【vue2.x(一)】第一个vue程序

1. vue简介

Vue.js是一套构建用户界面的渐进式js框架。与其他重量级框架不同,Vue 采用自底向上增量开发的设计。Vue 的核心库只关注视图层,非常容易与其它库或已有项目整合。Vue 完全有能力驱动采用单文件组件和Vue生态系统支持的库开发的复杂单页应用。

Vue.js 的目标是通过尽可能简单的 API 实现响应的数据绑定和组合的视图组件 。

作者: 尤雨溪(前Google工程师,目前在阿里巴巴上班)

官网英文:https://vuejs.org/

官网中文:https://cn.vuejs.org/

学习vue框架,需要具备html、css、javascript基础。

2. vue开发工具

常用工具如下,我们选用vscode 或 hbuilderx。

  • Visual Studio Code(免费)

  • WebStorm(收费)

  • HBuilder X(免费)

3. 第一个vue程序

3.1. 下载vue2.x版本

进入https://cn.vuejs.org/v2/guide/installation.html ,选择开发版或生产版下载。
在这里插入图片描述

3.2. 实现第一个vue程序

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>第一个vue程序</title>
		// 引入vue.js文件
		<script src="../js/vue.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		// div块是vue模板
		<div id="app">
			<p>{{msg}}</p>
		</div>
		<script type="text/javascript">
			// 创建vue实例
			const app = new Vue({
				el:'#app', // el将vue实例与id=app的div进行绑定
				data:{     // data中定义的数据,供div使用
					msg:'Hello World vue.js'
				}
			})
		</script>
	</body>
</html>
微信扫码关注微信公众号【程序员战羽】
获取更多技术内容

在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
Learn the fundamentals of vue.js by creating complex SPAs with Vuex, vue-router and more Key Features We bridge the gap between "learning" and "doing" by providing real-world examples that will improve your web development skills with Vue.js Explore the exciting features of Vue.js 2 through practical and interesting examples Explore modern development tools and learn how to utilize them by building applications with Vue.js Book Description Vue.js is a frontend web framework which makes it easy to do just about anything, from displaying data up to creating full-blown web apps, and has become a leading tool for web developers. This book puts Vue.js into a real-world context, guiding you through example projects that helps you build Vue.js applications from scratch. With this book, you will learn how to use Vue.js by creating three Single Page web applications. Throughout this book, we will cover the usage of Vue, for building web interfaces, Vuex, an official Vue plugin which makes caching and storing data easier, and Vue-router, a plugin for creating routes and URLs for your application. Starting with a JSON dataset, the first part of the book covers Vue objects and how to utilize each one. This will be covered by exploring different ways of displaying data from a JSON dataset. We will then move on to manipulating the data with filters and search and creating dynamic values. Next, you will see how easy it is to integrate remote data into an application by learning how to use the Dropbox API to display your Dropbox contents in an application In the final section, you will see how to build a product catalog and dynamic shopping cart using the Vue-router, giving you the building blocks of an e-commerce store. What you will learn Looping through data with Vue.js Searching and filtering data Using components to display data Getting a list of files using the dropbox API Navigating through a file tree and loading folders from a URL

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

和光同其尘

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值