-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(drawer): item classes are not applied
fixes #247
- Loading branch information
Showing
1 changed file
with
67 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,67 @@ | ||
<template> | ||
<custom-link :link="link" | ||
class="mdc-drawer-item mdc-list-item" | ||
:class="[classes. itemClasses]" :style="styles" | ||
@click="onClick"> | ||
<span class="mdc-list-item__graphic" v-if="hasStartDetail"> | ||
<slot name="start-detail"> | ||
<i class="material-icons" aria-hidden="true">{{startIcon}}</i> | ||
</slot> | ||
</span> | ||
<slot></slot> | ||
</custom-link> | ||
</template> | ||
|
||
<script> | ||
import {DispatchEventMixin, CustomLinkMixin} from '../base' | ||
import {RippleBase} from '../ripple' | ||
export default { | ||
name: 'mdc-drawer-item', | ||
inject: ['mdcDrawer'], | ||
mixins: [DispatchEventMixin, CustomLinkMixin], | ||
props: { | ||
startIcon: String, | ||
temporaryClose: { | ||
type: Boolean, | ||
default: true | ||
}, | ||
activated: Boolean, | ||
exactActiveClass: { | ||
type: String, | ||
default: 'mdc-list-item--activated' | ||
} | ||
}, | ||
data () { | ||
return { | ||
classes: {}, | ||
styles: {} | ||
} | ||
}, | ||
computed: { | ||
itemClasses () { | ||
return { | ||
'mdc-list-item--activated': this.activated | ||
} | ||
}, | ||
hasStartDetail () { | ||
return this.startIcon || this.$slots['start-detail'] | ||
} | ||
}, | ||
methods: { | ||
onClick (evt) { | ||
this.mdcDrawer.isTemporary && this.temporaryClose | ||
&& this.mdcDrawer.close() | ||
this.dispatchEvent(evt) | ||
} | ||
}, | ||
mounted () { | ||
this.ripple = new RippleBase(this) | ||
this.ripple.init() | ||
}, | ||
beforeDestroy () { | ||
this.ripple && this.ripple.destroy() | ||
this.ripple = null | ||
} | ||
} | ||
</script> | ||
<template> | ||
<custom-link :link="link" | ||
class="mdc-drawer-item mdc-list-item" | ||
:class="[classes, itemClasses]" :style="styles" | ||
@click="onClick"> | ||
<span class="mdc-list-item__graphic" v-if="hasStartDetail"> | ||
<slot name="start-detail"> | ||
<i class="material-icons" aria-hidden="true">{{startIcon}}</i> | ||
</slot> | ||
</span> | ||
<slot></slot> | ||
</custom-link> | ||
</template> | ||
|
||
<script> | ||
import {DispatchEventMixin, CustomLinkMixin} from '../base' | ||
import {RippleBase} from '../ripple' | ||
export default { | ||
name: 'mdc-drawer-item', | ||
inject: ['mdcDrawer'], | ||
mixins: [DispatchEventMixin, CustomLinkMixin], | ||
props: { | ||
startIcon: String, | ||
temporaryClose: { | ||
type: Boolean, | ||
default: true | ||
}, | ||
activated: Boolean, | ||
exactActiveClass: { | ||
type: String, | ||
default: 'mdc-list-item--activated' | ||
} | ||
}, | ||
data () { | ||
return { | ||
classes: {}, | ||
styles: {} | ||
} | ||
}, | ||
computed: { | ||
itemClasses () { | ||
return { | ||
'mdc-list-item--activated': this.activated | ||
} | ||
}, | ||
hasStartDetail () { | ||
return this.startIcon || this.$slots['start-detail'] | ||
} | ||
}, | ||
methods: { | ||
onClick (evt) { | ||
this.mdcDrawer.isTemporary && this.temporaryClose | ||
&& this.mdcDrawer.close() | ||
this.dispatchEvent(evt) | ||
} | ||
}, | ||
mounted () { | ||
this.ripple = new RippleBase(this) | ||
this.ripple.init() | ||
}, | ||
beforeDestroy () { | ||
this.ripple && this.ripple.destroy() | ||
this.ripple = null | ||
} | ||
} | ||
</script> |