From 5e1e5f64e6d12f910cac3b7393066dc7baa0bad0 Mon Sep 17 00:00:00 2001 From: Marek Piasecki Date: Wed, 11 Jan 2023 18:32:56 +0100 Subject: [PATCH] add and set my integration of pro-router - as a file as I didn't publish it yet; set the routes --- src/index.js | 2 ++ src/lib/router_tag.imba | 33 +++++++++++++++++++++++++++++++++ src/router.imba | 0 3 files changed, 35 insertions(+) create mode 100644 src/lib/router_tag.imba create mode 100644 src/router.imba 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