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 ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "yzx7661012345",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "main": "test3.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "keywords": [],
10
+ "author": "",
11
+ "license": "ISC",
12
+ "type": "commonjs"
13
+ }
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
@@ -0,0 +1,13 @@
1
+ const {xh} = require('./test.js')
2
+ const {npc} = require('./test2.js')
3
+
4
+
5
+
6
+
7
+
8
+
9
+ module.exports = {
10
+ xh: xh,
11
+ npc: npc
12
+
13
+ }
package/test4.js ADDED
@@ -0,0 +1,9 @@
1
+ const { xh, npc } = require('./test3.js')
2
+
3
+ var x = new xh('消耗品一号')
4
+ x.diuqi();
5
+ x.naijiu();
6
+
7
+ var y = new npc('张三', '逗逼')
8
+ y.move()
9
+ y.talk()