Skip to content

Commit

Permalink
point-label组件添加组件卸载方法
Browse files Browse the repository at this point in the history
  • Loading branch information
hinikai committed Oct 30, 2017
1 parent b7b924c commit 837f94f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/dist/react-bmap.min.js

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions docs/examples/build/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -31761,6 +31761,7 @@ var App = function (_Component) {
var _this = _possibleConstructorReturn(this, (App.__proto__ || Object.getPrototypeOf(App)).call(this, args));

_this.state = {};
_this.tips = [];
return _this;
}

Expand All @@ -31787,8 +31788,10 @@ var App = function (_Component) {
}, {
key: 'destroy',
value: function destroy() {
this.props.map.removeOverlay(this.marker);
this.marker = null;
this.tips.forEach(function (tip) {
tip.hide();
});
this.tips = [];
}
}, {
key: 'initialize',
Expand Down Expand Up @@ -31821,6 +31824,7 @@ var App = function (_Component) {
change: function change() {}
});
tip.show();
this.tips.push(tip);
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-bmap",
"version": "1.0.50",
"version": "1.0.51",
"description": "react-bmap",
"main": "lib/index.js",
"contributors": [
Expand Down
8 changes: 6 additions & 2 deletions src/components/point-label.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export default class App extends Component {
super(args);
this.state = {
};
this.tips = [];
}

/**
Expand All @@ -37,8 +38,10 @@ export default class App extends Component {
}

destroy() {
this.props.map.removeOverlay(this.marker);
this.marker = null;
this.tips.forEach((tip) => {
tip.hide();
});
this.tips = [];
}

initialize() {
Expand Down Expand Up @@ -71,6 +74,7 @@ export default class App extends Component {
change: function() {}
});
tip.show();
this.tips.push(tip);
});
}
}
Expand Down

0 comments on commit 837f94f

Please sign in to comment.