{"id":22476,"library":"trame-router","title":"trame-router","description":"Vue Router integration for trame, providing navigation and route management for trame applications. Current version 2.3.0, actively maintained as part of the trame ecosystem.","status":"active","version":"2.3.0","language":"python","source_language":"en","source_url":"https://github.com/Kitware/trame-router","tags":["trame","vue-router","widgets","navigation"],"install":[{"cmd":"pip install trame-router","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Core framework required","package":"trame","optional":false},{"reason":"Common UI components for navigation","package":"trame-vuetify","optional":true}],"imports":[{"note":"","wrong":"","symbol":"RouterView","correct":"from trame_router.widgets import RouterView"},{"note":"","wrong":"","symbol":"RouterLink","correct":"from trame_router.widgets import RouterLink"}],"quickstart":{"code":"from trame.app import get_server\nfrom trame_router.widgets import RouterView, RouterLink\nserver = get_server()\nserver.state['routes'] = [\n    {'path': '/', 'component': 'Home'},\n    {'path': '/about', 'component': 'About'}\n]\n@server.expose\ndef navigate():\n    server.state.trame__router = '/about'\nwith server.layout as layout:\n    layout.add_child(RouterLink(to=\"/about\", label=\"About\"))\n    layout.add_child(RouterView())\nserver.start()","lang":"python","description":"Basic setup for a trame app with Vue Router."},"warnings":[{"fix":"Update imports: from trame_router.widgets import RouterView, RouterLink","message":"In version 2.0.0, the import path changed from 'trame_router' to 'trame_router.widgets'. Old imports will break.","severity":"breaking","affected_versions":"<2.0.0"},{"fix":"Create Vue components in separate .js files or use trame's component registration.","message":"Routes must be defined in server.state['routes'] and components must be registered as strings (names of Vue components). Defining components inline in Python does not work.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use 'from trame_router.widgets import RouterView'","cause":"Incorrect import path after version 2.0.0.","error":"ImportError: cannot import name 'RouterView' from 'trame_router'"},{"fix":"Ensure the component string matches a registered Vue component (e.g., via .js file or trame's component decorator).","cause":"Route component name not registered as a Vue component.","error":"Vue warn: Component is missing template or render function"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}