UNPKG

vuetify

Version:

Vue.js 2 Semantic Component Framework

80 lines (66 loc) 2.31 kB
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } // Mixins import Colorable from '../../mixins/colorable'; import Routable from '../../mixins/routable'; import Toggleable from '../../mixins/toggleable'; // Directives import Ripple from '../../directives/ripple'; export default { name: 'v-list-tile', mixins: [Colorable, Routable, Toggleable], directives: { Ripple: Ripple }, inheritAttrs: false, data: function data() { return { proxyClass: 'list__tile--active' }; }, props: { activeClass: { type: String, default: 'primary--text' }, avatar: Boolean, inactive: Boolean, tag: String }, computed: { listClasses: function listClasses() { return this.disabled ? 'text--disabled' : this.color ? this.addTextColorClassChecks() : this.defaultColor; }, classes: function classes() { return _defineProperty({ 'list__tile': true, 'list__tile--link': this.isLink && !this.inactive, 'list__tile--avatar': this.avatar, 'list__tile--disabled': this.disabled, 'list__tile--active': !this.to && this.isActive }, this.activeClass, this.isActive); }, isLink: function isLink() { return this.href || this.to || this.$listeners && (this.$listeners.click || this.$listeners['!click']); } }, render: function render(h) { var isRouteLink = !this.inactive && this.isLink; var _ref2 = isRouteLink ? this.generateRouteLink() : { tag: this.tag || 'div', data: { class: this.classes } }, tag = _ref2.tag, data = _ref2.data; data.attrs = Object.assign({}, data.attrs, this.$attrs); return h('li', { 'class': this.listClasses, attrs: { disabled: this.disabled }, on: _extends({}, this.$listeners) }, [h(tag, data, this.$slots.default)]); } };