diff --git a/src/router/hash-router.js b/src/router/hash-router.js index 78312ab..9ba9141 100644 --- a/src/router/hash-router.js +++ b/src/router/hash-router.js @@ -19,6 +19,8 @@ const RULE_REGEXP = /(:id)|(\{id\})|(\{id:([A-z\d\,\[\]\{\}\-\+\*\?\!:\^\$]*)\})/g class Router { + type = 'hash' + #tables = new Map() #views = new Set() diff --git a/src/router/index.js b/src/router/index.js index 1600ad8..16b8979 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -79,8 +79,41 @@ class RouterView extends Component { } class RouterLink extends Component { + static props = { + to: Object, + disabled: false + } + + static styles = css` + :host { + display: inline-flex; + } + a { + color: inherit; + text-decoration: inherit; + cursor: pointer; + } + + :host([disabled]) a { + opacity: 0.6; + cursor: not-allowed; + } + ` + + #navigate() { + let type = this.$router.type + if (this.disabled) { + return + } + if (type === 'hash') { + // + } else { + // + } + } + render() { - return html`` + return html` ` } }