can
Version:
MIT-licensed, client-side, JavaScript framework that makes building rich web applications easy.
27 lines (22 loc) • 717 B
JavaScript
import { StacheElement, stacheRouteHelpers } from "can";
class PageHome extends StacheElement {
static get view() {
return `
<h1><code><page-home></code></h1>
<p>This content is provided by the <code><page-home></code> component.
Please click one of the tasks below to be directed to one of their pages
or click <i>Logout</i> to log out.
</p>
<ul>
<li><a href="{{ routeUrl(page='tasks' taskId='0') }}">Task 0</a></li>
<li><a href="{{ routeUrl(page='tasks' taskId='1') }}">Task 1</a></li>
</ul>
<button on:click="this.logout()">Logout</button>
`;
}
static get props() {
return {};
}
}
customElements.define("page-home", PageHome);
export default PageHome;