Changeset View
Changeset View
Standalone View
Standalone View
src/resources/vue/Widgets/StatusMessage.vue
Show All 12 Lines | |||||
<script> | <script> | ||||
const defaultLabels = { | const defaultLabels = { | ||||
init: 'Loading...', | init: 'Loading...', | ||||
404: 'Resource not found.' | 404: 'Resource not found.' | ||||
} | } | ||||
export default { | export default { | ||||
props: { | props: { | ||||
status: { type: String, default: () => 'init' }, | status: { type: [String, Number], default: 'init' }, | ||||
statusLabels: { type: Object, default: () => defaultLabels } | statusLabels: { type: Object, default: defaultLabels } | ||||
}, | }, | ||||
methods: { | methods: { | ||||
statusClass() { | statusClass() { | ||||
let className = 'status-message' | let className = 'status-message' | ||||
if (this.status === 'init') { | if (this.status === 'init') { | ||||
className += ' loading' | className += ' loading' | ||||
} else if (Number(this.status) >= 400) { | } else if (Number(this.status) >= 400) { | ||||
Show All 19 Lines |