Skip to content

Instantly share code, notes, and snippets.

@jonyrock
Created February 25, 2017 20:03
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 jonyrock/ea7c1839b10d07db36e518be7bb6eabe to your computer and use it in GitHub Desktop.
Save jonyrock/ea7c1839b10d07db36e518be7bb6eabe to your computer and use it in GitHub Desktop.
<template>
<div></div>
</template>
<script>
export default {
mounted: function() {
var div = this.$el;
var one = document.createElement("div");
one.appendChild(document.createTextNode("one"));
div.appendChild(one);
one.className = 'one'
// vue loader will add data attribute for scoped styles
var STYLE_MODULE_NAME = this.$el.attributes[0].name;
// please, don't make me do it
one.setAttribute(STYLE_MODULE_NAME, "11");
}
}
</script>
<style scoped>
.one {
background: #e1d4c0
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment