2 <article v-if="item" class="message" :class="item.style">
3 <div v-if="item.title" class="message-header">
4 <p>{{ item.title }}</p>
6 <div v-if="item.content" class="message-body" v-html="item.content"></div>
16 created: function () {
17 // Look for a new message if an endpoint is provided.
19 if (this.item && this.item.url) {
20 this.getMessage(this.item.url).then(function (message) {
21 // keep the original config value if no value is provided by the endpoint
22 for (const prop of ["title", "style", "content"]) {
23 if (prop in message && message[prop] !== null) {
24 that.item[prop] = message[prop];
31 getMessage: function (url) {
32 return fetch(url).then(function (response) {
33 if (response.status != 200) {
36 return response.json();