Trame-router extend trame widgets and ui with Vue Router components and helper to streamline its usage with trame. Vue Router is the official router for Vue.js on which trame is based.
Installing
trame-router can be installed with pip:
pip install trame-router
Development
# Create venv and install all dependencies
uv sync --all-extras --dev
# Activate environment
source .venv/bin/activate
# Install commit analysis
pre-commit install
pre-commit install --hook-type commit-msg
# Run pre-commit
pre-commit run --all-files
Usage
The Trame Tutorial is the place to go to learn how to use the library and start building your own application.
The API Reference documentation provides API-level documentation.
The original Vue Router documentation provide a great introduction resource.
The router elements can be used as follow in trame:
# [...]
from trame.ui.router import RouterViewLayout
from trame.widgets import router
with RouterViewLayout(server, "/"):
with vuetify.VCard():
vuetify.VCardTitle("This is home")
with RouterViewLayout(server, "/foo"):
with vuetify.VCard():
vuetify.VCardTitle("This is foo")
with RouterViewLayout(server, "/bar/:id"):
with vuetify.VList():
vuetify.VListItem("Bar {{ $route.params.id }} item 1")
vuetify.VListItem("Bar {{ $route.params.id }} item 2")
vuetify.VListItem("Bar {{ $route.params.id }} item 3")
with SinglePageWithDrawerLayout(server) as layout:
with layout.toolbar:
vuetify.VBtn("Home", to="/")
vuetify.VBtn("Foo", to="/foo")
vuetify.VBtn("Bar 1", to="/bar/1")
vuetify.VBtn("Bar 2", to="/bar/2")
vuetify.VBtn("Bar 3", to="/bar/3")
with layout.content:
router.RouterView()
Environment variables
With vue3 and docker, trame-router can leverage the html5 history mode but by default we use the “hash” mode. To enable it, you need to define a TRAME_ROUTER_HISTORY_MODE environment variable that should either be set to “html5” or “hash”. This can only work if using our docker bundle or with a proper web server configuration when delivering the static HTML/JS/CSS content yourself.
License
trame-router is made available under the MIT License. For more details, see LICENSE This license has been chosen to match the one use by Vue Router which is used under the cover.
Community
Trame | Discussions | Issues | Contact Us
Enjoying trame?
Share your experience with a testimonial or with a brand approval.
JavaScript dependency
This Python package bundle the following vue-router libraries. For client_type="vue2", it exposes vue-router@3.5.1 and for client_type="vue3", it exposes vue-router@4.2.4. If you would like us to upgrade any of those dependencies, please reach out.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file trame_router-2.3.3.tar.gz.
File metadata
- Download URL: trame_router-2.3.3.tar.gz
- Upload date:
- Size: 331.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b1b8717418d27de9b5865dad680c26b0e85a547d6a9a14e188ddaab7f1d3f09
|
|
| MD5 |
be80de0a57bbd77d908b81369370b176
|
|
| BLAKE2b-256 |
8ba07d53c5119b5b3d62114a5a00f980f11aba015f04a7f7a1df6bd428227599
|
Provenance
The following attestation bundles were made for trame_router-2.3.3.tar.gz:
Publisher:
test_and_release.yml on Kitware/trame-router
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
trame_router-2.3.3.tar.gz -
Subject digest:
5b1b8717418d27de9b5865dad680c26b0e85a547d6a9a14e188ddaab7f1d3f09 - Sigstore transparency entry: 2785366679
- Sigstore integration time:
-
Permalink:
Kitware/trame-router@948e4bf7272d7dd34f2fedf2811ab4c3c80fff1b -
Branch / Tag:
refs/heads/master - Owner: https://github.com/Kitware
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
test_and_release.yml@948e4bf7272d7dd34f2fedf2811ab4c3c80fff1b -
Trigger Event:
push
-
Statement type:
File details
Details for the file trame_router-2.3.3-py3-none-any.whl.
File metadata
- Download URL: trame_router-2.3.3-py3-none-any.whl
- Upload date:
- Size: 338.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f9a52d0cfc017fdc7ff90542f197e783ba8b2db38dc070ae7b8e34975fc86c71
|
|
| MD5 |
7860c7ca8824b1a7adacdf9fa7ac2839
|
|
| BLAKE2b-256 |
0644e1b2d2d18dcd6146127adde0a643c9a475029e218f6740c1a7a1dd6cb2d9
|
Provenance
The following attestation bundles were made for trame_router-2.3.3-py3-none-any.whl:
Publisher:
test_and_release.yml on Kitware/trame-router
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
trame_router-2.3.3-py3-none-any.whl -
Subject digest:
f9a52d0cfc017fdc7ff90542f197e783ba8b2db38dc070ae7b8e34975fc86c71 - Sigstore transparency entry: 2785366682
- Sigstore integration time:
-
Permalink:
Kitware/trame-router@948e4bf7272d7dd34f2fedf2811ab4c3c80fff1b -
Branch / Tag:
refs/heads/master - Owner: https://github.com/Kitware
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
test_and_release.yml@948e4bf7272d7dd34f2fedf2811ab4c3c80fff1b -
Trigger Event:
push
-
Statement type: