![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
javascript
轰轰战队冒险者
这个作者很懒,什么都没留下…
展开
-
如何在nginx下部署vue 项目
vim /etc/nginx/nginx.conf server { root /home/xxxx/home/; location /home { try_files $uri $uri/ @router; index index.html; } lo...原创 2020-04-14 20:35:06 · 205 阅读 · 0 评论 -
JS 策略模式
class A{ buy(){ console.log("Buy A") } } class B{ buy(){ console.log("Buy B") } } class C{ buy(){ console.log("Buy C") } } const a = new A(); a.buy() ...原创 2019-11-27 14:30:56 · 84 阅读 · 0 评论 -
JS 桥接模式
class Color{ constructor(name){ this.name = name } } class Shape{ constructor(name,color){ this.name = name this.color = color } draw(){ console.l...原创 2019-11-27 14:19:47 · 154 阅读 · 0 评论 -
JS 原型模式
const prototype = { getName(){ return this.first+ ' - '+this.last; }, say(){ console.log('hello') } } const x = Object.create(prototype) x.first = "张三" x.last = "李四" ...原创 2019-11-27 14:13:00 · 141 阅读 · 0 评论 -
JS状态模式
class State{ constructor(color){ this.color = color } handle(context){ console.log(`turn to ${this.color} light`) context.setState(this) } } class Context{ ...原创 2019-11-23 10:22:47 · 132 阅读 · 0 评论 -
JS观察者模式与NodeJS自定义事件
class Subject{ constructor(){ this.state = 0; this.observers = []; } setState(state){ this.state = state; this.notifyAllObservers(); } getState(){ ...原创 2019-11-23 09:03:30 · 150 阅读 · 0 评论 -
JS观察者模式
class Subject{ constructor(){ this.state = 0 this.observers = [] } getState(){ return this.state } setState(state){ this.state = state this...原创 2019-11-22 09:31:03 · 61 阅读 · 0 评论 -
JS代理模式
class ReadImg{ constructor(fileName){ this.fileName = fileName this.loadFromDisk() } display(){ console.log("display..............."+this.fileName) } loadF...原创 2019-11-21 11:35:42 · 62 阅读 · 0 评论 -
JS适配器模式
class Adaptee{ specificRequest(){ return "德国标准插头" } } class Target{ constructor(){ this.adaptee = new Adaptee() } request(){ let info = this.adaptee.speci...原创 2019-11-20 09:11:17 · 60 阅读 · 0 评论 -
JS单例模式
class SingleObject{ constructor(){ this.name = "sun" } login(){ console.log('login............') } setName(name){ this.name = name } getName(){ ...原创 2019-11-20 08:39:37 · 62 阅读 · 0 评论 -
JS工厂模式的例子
class Person{ constructor(name,age){ this.name = name; this.age = age; } eat(){ console.log(`I am ${this.name} eat `) } speak(){ console.log(`My nam...原创 2019-11-19 10:05:30 · 146 阅读 · 0 评论 -
欢迎使用CSDN-markdown编辑器
BootStrap代码: <!-- <code></code> 表示内联的方式的显示 就是以一整行的方式显示--> <!-- 例子 <代表"<" >代表">" --> <p> <code> <html> <head> </head原创 2017-05-24 13:21:24 · 179 阅读 · 0 评论 -
JavaScript变量对象的深入
什么是变量对象 变量对象是执行的上下文相关的作用域的对象先引出第一个关键词 全局对象 全局对象是预定义对象 通过全局对象可以访问其他所有的预定义对象的函数,属性。 在顶层的Javascript中可以使用的this关键字 我们可以看到this 的全局对象的是window this 是全局对象的但也是Object实例化的一个对象 可以看到this是顶层对象 还可以做例子:原创 2017-05-24 13:05:12 · 144 阅读 · 0 评论