2018-07-11 17:22:44 +00:00
|
|
|
<script>
|
|
|
|
const parse = require("../js/libs/handlebars/parse");
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: "ParsedMessage",
|
2018-07-12 08:26:12 +00:00
|
|
|
functional: true,
|
2018-07-11 17:22:44 +00:00
|
|
|
props: {
|
2018-07-12 08:41:40 +00:00
|
|
|
text: String,
|
2018-07-11 17:22:44 +00:00
|
|
|
message: Object,
|
|
|
|
},
|
|
|
|
render(createElement, context) {
|
2018-07-12 08:41:40 +00:00
|
|
|
if (typeof context.props.text !== "undefined") {
|
|
|
|
return parse(createElement, context.props.text);
|
|
|
|
}
|
|
|
|
|
|
|
|
return parse(createElement, context.props.message.text, context.props.message);
|
2018-07-11 17:22:44 +00:00
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|