自定义元素中的子路由器

编程入门 行业动态 更新时间:2024-10-24 17:24:25
本文介绍了自定义元素中的子路由器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试将路由器添加到自定义元素.元素应具有两个子视图,用户可以在其中进行切换.但是,我遇到了一个问题:

I am trying to add a router to a custom element. The element should have two subviews where user can switch between them. However, I have run into a problem:

export class customElement { configureRouter(config,router) { ... } //this is not getting called }

此问题是相关的,并且对该问题的回答是:如果它是自定义元素,它将不起作用."

This question is related and an answer to the question states that "It will not work if it is a custom element."

有没有解决方法?或者这是不可能的吗?

Is there a workaround or is this just not possible?

推荐答案

这是不可能的.自定义元素与路由视图模型不同.而且Aurelia无法提供使用自定义元素轻松实现此目标的方法.

This is not possible. Custom elements are not the same as routed view-models. And Aurelia offers no way you can easily achieve this with a custom element.

更多推荐

自定义元素中的子路由器

本文发布于:2023-11-25 14:13:06,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1630079.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:自定义   路由器   元素

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!