Created
April 26, 2017 11:42
-
-
Save eirikb/b2870a292462a45051275ae4a03d9edb to your computer and use it in GitHub Desktop.
MDL in Vue2 hack
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
import Vue from 'vue'; | |
import 'material-design-lite'; | |
Vue.mixin({ | |
mounted() { | |
for (const el of this.$el.querySelectorAll('[class*=mdl-js-]')) { | |
if (!el.dataset.upgraded) { | |
componentHandler.upgradeElement(el); | |
} | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment