@iyulab/router 0.7.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +4 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -190,6 +190,7 @@ function getRandomID() {
|
|
|
190
190
|
}
|
|
191
191
|
function findOutlet(element) {
|
|
192
192
|
if (!element) return void 0;
|
|
193
|
+
if (element.tagName === "U-OUTLET") return element;
|
|
193
194
|
let outlet = void 0;
|
|
194
195
|
if (element.shadowRoot) {
|
|
195
196
|
outlet = element.shadowRoot.querySelector("u-outlet");
|
|
@@ -222,7 +223,9 @@ async function waitOutlet(element, timeout = 1e4) {
|
|
|
222
223
|
if (outlet) return outlet;
|
|
223
224
|
await new Promise((r) => setTimeout(r, 50));
|
|
224
225
|
}
|
|
225
|
-
throw new Error(
|
|
226
|
+
throw new Error(
|
|
227
|
+
`Timed out waiting for <u-outlet> inside <${element.tagName.toLowerCase()}>. Ensure that the router root element contains a <u-outlet> child.`
|
|
228
|
+
);
|
|
226
229
|
}
|
|
227
230
|
function findAnchorFrom(event) {
|
|
228
231
|
const targets = event.composedPath() || [];
|