diff --git a/src/index.js b/src/index.js index e6824ab..3587164 100644 --- a/src/index.js +++ b/src/index.js @@ -1 +1,3 @@ +import "pro-router/standalone" +import "./router.imba" import "./main.imba" \ No newline at end of file diff --git a/src/lib/router_tag.imba b/src/lib/router_tag.imba new file mode 100644 index 0000000..7cfdc19 --- /dev/null +++ b/src/lib/router_tag.imba @@ -0,0 +1,33 @@ +tag pro-router + prop view + <{ "view-{view || R.view }" }> + +tag pro-toggle + prop param + prop disabled + + css cursor:pointer cursor.disabled:default + + def render + + +tag pro-ref-f < a # f - forget current params in new destination + prop view + prop params = {} + prop go + + def render + let link = go || url + + + get url + R.to_path view, params + +tag pro-ref < pro-ref-f + get url + #params = JSON.parse JSON.stringify(params) # duplicate object + #params[k] ||= v for own k, v of R.safe_params + R.to_path view, #params + +tag view-not_found +

"Page not found :(" \ No newline at end of file diff --git a/src/router.imba b/src/router.imba new file mode 100644 index 0000000..e69de29