Fixed a bug relating to custom-elements's first vnode where render(){ return <div class="example" /> } would set the example-class on the custom-element itself.
Added support for className and style similar to react Cleaned up some comments Reworked how tests are built in order to add a new test "pdf" which was a small side-project where previous mentioned bug showed up, it's an example using HTML to create a PDF for printing
This commit is contained in:
47
tests/svg/index.jsx
Normal file
47
tests/svg/index.jsx
Normal file
@@ -0,0 +1,47 @@
|
||||
import {render} from "../../packages/csx";
|
||||
import style from "./index.scss";
|
||||
import {SvgLoader} from "./svg-loader";
|
||||
import {SvgTester} from "./svg-tester";
|
||||
import {SvgTesterTwo} from "./svg-tester-two";
|
||||
|
||||
let loader = render(<SvgLoader inverted="yes"/>);
|
||||
|
||||
document.body.appendChild(render(<style>{style}</style>));
|
||||
document.body.appendChild(render(
|
||||
<div class="center-me">
|
||||
<h3>SVG Loader</h3>
|
||||
{loader}
|
||||
<h3>SVG Tester</h3>
|
||||
<SvgTester/>
|
||||
<h3>SVG Tester Two</h3>
|
||||
<SvgTesterTwo/>
|
||||
</div>
|
||||
));
|
||||
|
||||
|
||||
setTimeout(()=>{
|
||||
console.log("Uninverting");
|
||||
loader.removeAttribute("inverted");
|
||||
|
||||
setTimeout(()=>{
|
||||
console.log("Inverting");
|
||||
loader.setAttribute("inverted", "ja");
|
||||
|
||||
setTimeout(()=>{
|
||||
console.log("Stays inverted");
|
||||
loader.setAttribute("inverted", "");
|
||||
|
||||
setTimeout(()=>{
|
||||
console.log("Inverted color");
|
||||
loader.setAttribute("inverted-color", "#0F0");
|
||||
}, 1000);
|
||||
}, 1000);
|
||||
}, 1000);
|
||||
|
||||
|
||||
}, 1000);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user