JSFiddle - React, Tailwind, and code Playground
by proticm
HTML
<script src="https://cdn.jsdelivr.net/npm/@plazarjs/core/dist/core.min.js"></script>
<div class="my-css-class">
<p>
<span>Hello, my name is {name} {surname}, and </span>
<span data-text="sayHello"></span>
</p>
</div>
JavaScript
pz.define('my-component', {
ownerType: 'component',
autoLoad: true,
templateSelector: 'div.my-css-class', // this config holds the CSS selector
viewModel: {
name: 'John',
surname: 'Doe',
sayHello: function() {
return 'I salute you!';
}
}
// other configs
}).create();