Last active
September 15, 2019 09:05
-
-
Save Odepax/768decca940c3510122ef9e600d7f5f4 to your computer and use it in GitHub Desktop.
Reading VueJs-like single-file components with Powershell, premise for other manipulations...
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
# 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 | |
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
<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