package vue-jsoo

  1. Overview
  2. Docs

Create router object

type redirect =
  1. | Rd of string
  2. | Rd_name of string

redirect to path or to named route

type push_obj = {
  1. pu_path : string option;
  2. pu_name : string option;
  3. params : (string * string) list option;
  4. query : (string * string) list option;
}

route argument object for the router methods

val empty_arg : push_obj

empty route object argument

type props =
  1. | PrBool of bool
  2. | PrObj of Mjs.any
  3. | PrFn of push_obj -> Mjs.any

props argument can be a bool, and object or a function

module Internal : sig ... end

Internal module

type router = Internal.router Mjs.t

router class type

Call router methods

type push_arg =
  1. | PStr of string
  2. | PObj of push_obj

route argument can be a string or an object

val push : router -> push_arg -> unit

push to new route

val replace : router -> push_arg -> unit

replace to new route

val go : router -> int -> unit

go to n next route

val before_hook : router -> (push_obj -> push_obj -> (unit -> unit) -> unit) -> unit

register hook before each navigation

val resolve_hook : router -> (push_obj -> push_obj -> (unit -> unit) -> unit) -> unit

register hook before each navigation confirmation

val after_hook : router -> (push_obj -> push_obj -> (unit -> unit) -> unit) -> unit

register hook after each navigation

type ('a, 'b) route_ml = ('a, 'b) Internal.route_ml = {
  1. path : string;
  2. component : ('a, 'b) Vue_component.component_args option;
  3. children : (Mjs.top, Mjs.top) Internal.route Mjs.t list option;
  4. name : string option;
  5. components : ('a, 'b) Vue_component.component_args Mjs.table_cons option;
  6. redirect : redirect option;
  7. alias : string option;
  8. props : props option;
  9. hook : (push_obj -> push_obj -> (unit -> unit) -> unit) option;
}

route object

val empty : string -> ('a, 'b) route_ml

empty route with path

val make : ?mode:string -> (Mjs.top, Mjs.top) route_ml list -> router

make router from route list

module type Tables_S = sig ... end
module Tables : Tables_S
OCaml

Innovation. Community. Security.