This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<ul> | |
<li v-for="item in levelItems"> | |
{{ item.title }} | |
<tree :items="items" | |
:left="item.left" | |
:right="item.right"> | |
</tree> | |
</li> | |
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Vue from 'vue'; | |
import VueRouter from 'vue-router'; | |
Vue.use(VueRouter); | |
Vue.use(VueEvents); | |
const routes = [ | |
{ | |
name: 'lease_wrap_create', | |
path: '/lease', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ol { | |
list-style-type: none; | |
counter-reset: li; | |
} | |
li { | |
font-size: 2rem; | |
} | |
li:before { | |
counter-increment: li; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const sum = (a) => (b) => { | |
return b !== undefined ? sum(a + b) : a | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Dictionary { | |
constructor() { | |
this.obj = {}; | |
this.dictionary = { | |
A: 2, | |
B: 2, | |
C: 2, | |
D: 3, | |
E: 3, | |
F: 3, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const binpowCount = () => { | |
let i = 0; | |
return function binpow (a, b) { | |
i++ | |
if (b === 1) { | |
console.log(i) | |
return a; | |
} | |
return b & 1 ? a * binpow(a, b - 1) : binpow(a, b >> 1 ) ** 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Event { | |
constructor() { | |
this.cb = () => {}; | |
} | |
on(newEvent, cb) { | |
const oldCb = this.cb; | |
this.cb = event => { | |
oldCb(event); |