Vue2
-
Promise基本使用
<body> <script type="text/javascript"> /* Promise基本使用 */ // console.log(typeof Promise) // console.dir(Promise); var p = new Promise(function(resolve, reject){ // 这里用于实现异步任务 setTimeout(function(){ var flag = false; if(flag) { // 正常情况 resolve('hello'); }else{ // 异常情况 reject('出错了'); } }, 1
-
异步编程与Promise概述
<body> <div>前后端交互</div> <script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript"> /* 前后端交互-异步编程与Promise概述 */ // var ret = '---'; // $.ajax({ // url: 'http://localhost:3000/data', // success: function(data) { // ret = data; // cons
-
购物车案例完成列表组件更新商品数量下
<head> <meta charset="UTF-8"> <title>Document</title> <style type="text/css"> .container { } .container .cart { width: 300px; margin: auto; } .container .title { background-color: lightblue; height: 40px; line-height: 40px; text-align: center; /*color: #fff;*/ } .contai
-
购物车案例完成列表组件更新商品数量上
<head> <meta charset="UTF-8"> <title>Document</title> <style type="text/css"> .container { } .container .cart { width: 300px; margin: auto; } .container .title { background-color: lightblue; height: 40px; line-height: 40px; text-align: center; /*color: #fff;*/ } .contai
-
购物车案例完成列表组件删除商品功能
<head> <meta charset="UTF-8"> <title>Document</title> <style type="text/css"> .container { } .container .cart { width: 300px; margin: auto; } .container .title { background-color: lightblue; height: 40px; line-height: 40px; text-align: center; /*color: #fff;*/ } .contai
-
购物车案例完成标题和结算组件功能
<head> <meta charset="UTF-8"> <title>Document</title> <style type="text/css"> .container { } .container .cart { width: 300px; margin: auto; } .container .title { background-color: lightblue; height: 40px; line-height: 40px; text-align: center; /*color: #fff;*/ } .contai