Skip to content

Commit

Permalink
re-render visual components on destroy
Browse files Browse the repository at this point in the history
  • Loading branch information
dneustadt committed Aug 6, 2020
1 parent 53da8d0 commit 0025c70
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 8 deletions.
13 changes: 11 additions & 2 deletions dist/VueRough.common.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 11 additions & 2 deletions dist/VueRough.umd.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-rough",
"version": "1.0.0",
"version": "1.1.0",
"description": "A small components library to use Rough.js in Vue.",
"homepage": "https://vue-rough.neustadt.dev",
"bugs": {
Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ options.

## Visual Components

Shown below is a quick overview over the available components with their required properties.
All components may use additional properties. See the [Rough.js wiki](https://github.com/rough-stuff/rough/wiki#options) for a list of available
Shown below is a quick overview of the available components with their required properties.
All components may use additional properties. See the [Rough.js wiki](https://github.com/rough-stuff/rough/wiki#options)
for a full list of options. Components must be placed inside `rough-canvas` or `rough-svg`

### rough-line
Expand Down
8 changes: 8 additions & 0 deletions src/mixins/element.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ export default {
render() {
return this.$scopedSlots;
},
destroyed() {
const rough = this.$parent.rough;
if (rough.svg) {
if (this.element) this.$parent.remove(this.element);
} else {
this.$parent.$emit('rerender');
}
},
methods: {
createElement: function (func, ops, forceRender = false) {
const rough = this.$parent.rough;
Expand Down

0 comments on commit 0025c70

Please sign in to comment.