|
@@ -261,15 +261,15 @@ class State(Base, ABC):
|
|
|
field.required = False
|
|
|
field.default = default_value
|
|
|
|
|
|
- def get_current_page(cls) -> str:
|
|
|
+ def get_current_page(self) -> str:
|
|
|
"""Obtain the path of current page from the router data.
|
|
|
|
|
|
Returns:
|
|
|
The current page.
|
|
|
"""
|
|
|
- return cls.router_data.get("pathname", "")
|
|
|
+ return self.router_data.get("pathname", "")
|
|
|
|
|
|
- def get_query_params(cls) -> Dict[str, str]:
|
|
|
+ def get_query_params(self) -> Dict[str, str]:
|
|
|
"""Obtain the query parameters for the queried page.
|
|
|
|
|
|
The query object contains both the URI parameters and the GET parameters.
|
|
@@ -277,7 +277,7 @@ class State(Base, ABC):
|
|
|
Returns:
|
|
|
The dict of query parameters.
|
|
|
"""
|
|
|
- return cls.router_data.get("query", {})
|
|
|
+ return self.router_data.get("query", {})
|
|
|
|
|
|
def __getattribute__(self, name: str) -> Any:
|
|
|
"""Get the state var.
|