components - 当`customElement:true`时如何使用`svelte-spa-router`?
问题描述
我这样使用它:
<script>
import Router from "svelte-spa-router";
</script>
<Router routes={{}} />
我得到了一些编译时警告和运行时错误:
啊,而且,当我尝试使用其他没有<svelte:options tag="xxx" />
标记的组件时,我也收到了警告/错误。
又怎样?
解决方案
- 您应该将标签设置为“xxx-yyy”;
- 在 vite 或汇总配置中设置 svelte({ compilerOptions: { customElement: true }})
推荐阅读
- sqlite - How do I read this figure on the sqlite documentation?
- quartz.net - Quartz 的较低日志级别
- linux - 调用 ttymxc 上的打开函数时的 rcu_preempt
- unity3d - Unity - 创建 Android 菜单项(3 个垂直点和返回箭头按钮)
- apache - .htaccess 规则将爬虫重定向到另一个文件夹
- python - use python request to load more items
- elasticsearch - 动态映射大于 2^63 - 1 的数值字段数据类型(long 类型)
- url-routing - TYPO3 9.5 URL Routing with URL Segment is not working
- javascript - 如何从 Vue.js 中的模板调用方法?
- c# - Application Gets Slow After Enable/Disable MDIChldren