Files
ga-covid.thederf.com/src/components/jscharting/JSLabel.vue
Joshua Bemenderfer bac61fe227 Initial commit.
2021-12-28 21:52:58 -05:00

36 lines
618 B
Vue

<template>
<div></div>
</template>
<script>
import * as JSC from 'jscharting';
export default {
name: 'JSCLabel',
props: {
options: { type: String, default: '' }
},
mounted: function() {
this.renderLabel();
},
beforeUnmount: function() {
this.destroyLabel();
},
watch: {
options: function() {
this.renderLabel();
}
},
methods: {
destroyLabel: function() {
const containerElement = this.$el;
containerElement.innerHTML = '';
},
renderLabel: function() {
this.destroyLabel();
const containerElement = this.$el;
JSC.label(containerElement, this.options);
}
}
};
</script>