文档部分内容更新

This commit is contained in:
xiejie 2022-01-21 13:34:01 +08:00
parent eed8577142
commit a23ef9c13e

View File

@ -58,7 +58,7 @@ class Computer {
上面的代码非常的简单,我们定义了一个名为 Computer 的类,该类存在 *name、price* 这两个实例属性,一个 *showSth* 的原型方法以及一个 *comStruct* 的静态方法。
上面的代码非常的简单,我们定义了一个名为 *Computer* 的类,该类存在 *name、price* 这两个实例属性,一个 *showSth* 的原型方法以及一个 *comStruct* 的静态方法。
@ -519,51 +519,51 @@ e.init();
> "use strict";
>
> function _classCallCheck(instance, Constructor) {
> if (!(instance instanceof Constructor)) {
> throw new TypeError("Cannot call a class as a function");
> }
> if (!(instance instanceof Constructor)) {
> throw new TypeError("Cannot call a class as a function");
> }
> }
>
> function _defineProperties(target, props) {
> for (var i = 0; i < props.length; i++) {
> var descriptor = props[i];
> descriptor.enumerable = descriptor.enumerable || false;
> descriptor.configurable = true;
> if ("value" in descriptor)
> descriptor.writable = true;
> Object.defineProperty(target, descriptor.key, descriptor);
> }
> for (var i = 0; i < props.length; i++) {
> var descriptor = props[i];
> descriptor.enumerable = descriptor.enumerable || false;
> descriptor.configurable = true;
> if ("value" in descriptor)
> descriptor.writable = true;
> Object.defineProperty(target, descriptor.key, descriptor);
> }
> }
>
> function _createClass(Constructor, protoProps, staticProps) {
> if (protoProps)
> _defineProperties(Constructor.prototype, protoProps);
> if (staticProps)
> _defineProperties(Constructor, staticProps);
> return Constructor;
> if (protoProps)
> _defineProperties(Constructor.prototype, protoProps);
> if (staticProps)
> _defineProperties(Constructor, staticProps);
> return Constructor;
> }
>
> var Example = /*#__PURE__*/function () {
> function Example(name) {
> _classCallCheck(this, Example);
> function Example(name) {
> _classCallCheck(this, Example);
>
> this.name = name;
> }
> this.name = name;
> }
>
> _createClass(Example, [{
> key: "init",
> value: function init() {
> var _this = this;
> _createClass(Example, [{
> key: "init",
> value: function init() {
> var _this = this;
>
> var fun = function fun() {
> console.log(_this.name);
> };
> var fun = function fun() {
> console.log(_this.name);
> };
>
> fun();
> }
> }]);
> fun();
> }
> }]);
>
> return Example;
> return Example;
> }();
>
> var e = new Example('Hello');