Skip to content

Instantly share code, notes, and snippets.

@Odepax
Last active September 15, 2019 09:05
Show Gist options
  • Save Odepax/768decca940c3510122ef9e600d7f5f4 to your computer and use it in GitHub Desktop.
Save Odepax/768decca940c3510122ef9e600d7f5f4 to your computer and use it in GitHub Desktop.
Reading VueJs-like single-file components with Powershell, premise for other manipulations...
# https://www.business.com/articles/powershell-read-xml-files/
# https://stackoverflow.com/questions/11685265/casting-in-powershell-weird-syntax#answer-11685318
$k = (([Xml]("<R>" + (Get-Content -Path ".\sfc.html") + "</R>")).R)
Start-Something -With $k.style
Start-Something -With $k.template
Start-Something -With $k.script
<style>
button.red {
background: red;
}
</style>
<template id="red-button">
<button class="red" data--="@mouseenter:focusCanvas @mousedown:focusCanvas">
Hellow, there!
</button>
</template>
<script>
class RedButton extends BaseComponent {
focusCanvas({ target, preventDefault }) {
preventDefault()
target.focus()
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment