Skip to content

Instantly share code, notes, and snippets.

@eirikb
Created April 26, 2017 11:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eirikb/b2870a292462a45051275ae4a03d9edb to your computer and use it in GitHub Desktop.
Save eirikb/b2870a292462a45051275ae4a03d9edb to your computer and use it in GitHub Desktop.
MDL in Vue2 hack
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