diff --git a/better-scroll/index.html b/better-scroll/index.html new file mode 100644 index 0000000..e2eb8ba --- /dev/null +++ b/better-scroll/index.html @@ -0,0 +1,34 @@ + + + + + + Document + + + + +
+ +
+ + + \ No newline at end of file diff --git a/better-scroll/long.png b/better-scroll/long.png new file mode 100644 index 0000000..08a8caa Binary files /dev/null and b/better-scroll/long.png differ diff --git a/index.html b/index.html index c16a62a..8da9c8d 100644 --- a/index.html +++ b/index.html @@ -6,6 +6,6 @@ Document - + \ No newline at end of file diff --git "a/\346\211\213\345\206\231create.js" "b/\346\211\213\345\206\231create.js" new file mode 100644 index 0000000..a0b66a4 --- /dev/null +++ "b/\346\211\213\345\206\231create.js" @@ -0,0 +1,27 @@ +// function A() { +// this.name = 'a' +// } + +// let a = Object.create(A) +// console.log(a) + +function create(proto) { + const F = function () {} + F.prototype = {...proto} + // F.prototype.constructor = proto.constructor + return new F() + // let obj = {} + // obj.__proto__ = proto + // // obj.constructor = proto.constructor + // return obj +} + +let obj = {a:1} +console.log(create(obj)) + +function Person() { + this.name = 'person' +} +let p = new Person() +console.log(create(p)) +console.log(Object.create(p)) \ No newline at end of file