yzx7661012345 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +13 -0
- package/test.js +27 -0
- package/test2.js +21 -0
- package/test3.js +13 -0
- package/test4.js +9 -0
package/package.json
ADDED
package/test.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
function Jichuwupin(name) {
|
|
2
|
+
this.name = name
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
Jichuwupin.prototype.diuqi = function () {
|
|
6
|
+
console.log(this.name + "被丢弃了")
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function Xiaohaowupin(name,consume) {
|
|
10
|
+
Jichuwupin.call(this, name);
|
|
11
|
+
this.consume = consume;
|
|
12
|
+
|
|
13
|
+
this.naijiu = function () {
|
|
14
|
+
console.log(this.name + "这是测试方法2")
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
Xiaohaowupin.prototype = new Jichuwupin("1");
|
|
20
|
+
Xiaohaowupin.prototype.constructor = Xiaohaowupin;
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
module.exports = {
|
|
25
|
+
xh:Xiaohaowupin
|
|
26
|
+
}
|
|
27
|
+
|
package/test2.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
class Gameobj {
|
|
2
|
+
constructor(name) {
|
|
3
|
+
this.name = name
|
|
4
|
+
}
|
|
5
|
+
move() {
|
|
6
|
+
console.log(this.name + '进行了移动')
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
class npc extends Gameobj {
|
|
11
|
+
constructor(name, title) {
|
|
12
|
+
super(name)
|
|
13
|
+
this.title = title
|
|
14
|
+
}
|
|
15
|
+
talk() {
|
|
16
|
+
console.log('头衔为:' + this.title + '的' + this.name + '说话了')
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
module.exports = {
|
|
20
|
+
npc:npc
|
|
21
|
+
}
|
package/test3.js
ADDED