Created
February 25, 2017 20:03
-
-
Save jonyrock/ea7c1839b10d07db36e518be7bb6eabe to your computer and use it in GitHub Desktop.
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
<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