2019-04-17 15:58:15 +02:00
|
|
|
// Styles
|
|
|
|
import '../../../src/stylus/components/_messages.styl';
|
|
|
|
// Mixins
|
|
|
|
import Colorable from '../../mixins/colorable';
|
|
|
|
import Themeable from '../../mixins/themeable';
|
|
|
|
import mixins from '../../util/mixins';
|
|
|
|
/* @vue/component */
|
|
|
|
export default mixins(Colorable, Themeable).extend({
|
|
|
|
name: 'v-messages',
|
|
|
|
props: {
|
|
|
|
value: {
|
|
|
|
type: Array,
|
|
|
|
default: function _default() {
|
|
|
|
return [];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
genChildren: function genChildren() {
|
|
|
|
return this.$createElement('transition-group', {
|
|
|
|
staticClass: 'v-messages__wrapper',
|
|
|
|
attrs: {
|
|
|
|
name: 'message-transition',
|
|
|
|
tag: 'div'
|
|
|
|
}
|
|
|
|
}, this.value.map(this.genMessage));
|
|
|
|
},
|
|
|
|
genMessage: function genMessage(message, key) {
|
|
|
|
return this.$createElement('div', {
|
|
|
|
staticClass: 'v-messages__message',
|
|
|
|
key: key,
|
|
|
|
domProps: {
|
|
|
|
innerHTML: message
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
render: function render(h) {
|
|
|
|
return h('div', this.setTextColor(this.color, {
|
|
|
|
staticClass: 'v-messages',
|
|
|
|
class: this.themeClasses
|
|
|
|
}), [this.genChildren()]);
|
|
|
|
}
|
|
|
|
});
|
2019-06-04 14:29:48 +02:00
|
|
|
//# sourceMappingURL=VMessages.js.map
|