2019-04-17 15:58:15 +02:00
|
|
|
import Vue from 'vue';
|
|
|
|
/**
|
|
|
|
* SSRBootable
|
|
|
|
*
|
|
|
|
* @mixin
|
|
|
|
*
|
|
|
|
* Used in layout components (drawer, toolbar, content)
|
|
|
|
* to avoid an entry animation when using SSR
|
|
|
|
*/
|
|
|
|
export default Vue.extend({
|
|
|
|
name: 'ssr-bootable',
|
|
|
|
data: function data() {
|
|
|
|
return {
|
|
|
|
isBooted: false
|
|
|
|
};
|
|
|
|
},
|
|
|
|
mounted: function mounted() {
|
|
|
|
var _this = this;
|
|
|
|
|
|
|
|
// Use setAttribute instead of dataset
|
|
|
|
// because dataset does not work well
|
|
|
|
// with unit tests
|
|
|
|
window.requestAnimationFrame(function () {
|
|
|
|
_this.$el.setAttribute('data-booted', 'true');
|
|
|
|
_this.isBooted = true;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
2019-06-04 14:29:48 +02:00
|
|
|
//# sourceMappingURL=ssr-bootable.js.map
|