mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-06-28 05:15:54 +00:00
* Fixed: Infinite loop bug with the `<markdown />` Vue component. * Fixed: Bug with the method that calculates the chat input height causing chat input to disappear completely. * Changed: When an add-on fails to enable, a slightly better message will be logged to console.
48 lines
No EOL
601 B
Vue
48 lines
No EOL
601 B
Vue
<template>
|
|
<!-- eslint-disable-next-line vue/no-v-html -->
|
|
<div v-html="output" />
|
|
</template>
|
|
|
|
<script>
|
|
|
|
import awaitMD, {getMD} from 'utilities/markdown';
|
|
|
|
export default {
|
|
props: {
|
|
source: String
|
|
},
|
|
|
|
data() {
|
|
return {
|
|
output: ''
|
|
}
|
|
},
|
|
|
|
watch: {
|
|
source() {
|
|
this.rebuild();
|
|
}
|
|
},
|
|
|
|
created() {
|
|
this.md = getMD();
|
|
if ( ! this.md )
|
|
awaitMD().then(md => {
|
|
this.md = md;
|
|
this.rebuild();
|
|
});
|
|
else
|
|
this.rebuild();
|
|
},
|
|
|
|
methods: {
|
|
rebuild() {
|
|
if ( ! this.md )
|
|
this.output = '';
|
|
else
|
|
this.output = this.md.render(this.source);
|
|
}
|
|
}
|
|
}
|
|
|
|
</script> |