nodejs学习初体验(3)api//url网址解析 // url.parse 将网址解析成对象 > url.parse('https://www.imooc.com/video/6710') > url.parse('https://www.imooc.com/video/6710',true) //query会被解析成对象 > url.parse('//www.imooc.com/vid2019-01-07浏览 2996
nodejs学习初体验(2)模块与包管理工具// 模块与包管理工具 npm install 模块的流程 1. 创建模块 test.js 2. 导出模块 (两种) exports.add = function(){} function add(){} exports.add = add 3. 加载模块 var tests = require('./test.js') 4. 使用模块 tests.add(2019-01-07浏览 2223
nodejs学习初体验(1)// 简单的搭建web服务器 var http = require('http'); var server = http.createServer(function(req,res){ res.writeHead(200,{'Content-Type':'text/plain'}); res.end('Hello,world'); }) server.lis2019-01-07浏览 2590
vue学习初体验(12)条件渲染{{message}} 11 var vm = new Vue({ el:"#app", data:{ show:false, message:'hello' } }) 2019-01-02浏览 2661
vue学习初体验(11)样式的绑定.activated{ color: brown } hello var vm = new Vue({ el:"#app", data:{ activated:"" }, methods:{ handClick:function(){ this.activated = this.activated ==="activated"?'':'activated';2019-01-02浏览 2203
vue学习初体验(10)计算属性的get与set{{fullName}} var vm = new Vue({ el:'#app', data:{ firstName:'Dell', lastName:'Lee', // fullName:"Dell Lee" }, //计算属性:有缓存机制,只要依赖的没有改变,则使用缓存数据 computed:{ fullName:{ get:function(){ r2019-01-02浏览 2499
vue学习初体验(9)属性方法监听器{{fullName}} var vm = new Vue({ el:'#app', data:{ firstName:'Dell', lastName:'Lee', fullName:"Dell Lee" }, methods:{ // 方法 // fullName:function(){ // return this.firstName+ " "+thi2019-01-02浏览 3269