我正在尝试将Tooltip与Svelte和SvelteStrap一起使用,需要一只手:(
最小的工作示例是:
<script>
import {
Button,
Tooltip,
} from 'sveltestrap';
</script>
<Button id="btntest">test</Button>
<Tooltip target="btntest" placement="top" />
悬停按钮后,它会显示一个工具提示(没有完全对齐(,并立即抛出一个错误:
Uncaught (in promise) ReferenceError: process is not defined
at Object.setOptions (createPopper.js:80)
at createPopper (createPopper.js:214)
at Object.$$self.$$.update (Tooltip.svelte:29)
at update (index.mjs:760)
at flush (index.mjs:732)
Package.json:
"devDependencies": {
"@rollup/plugin-commonjs": "^17.0.0",
"@rollup/plugin-node-resolve": "^11.0.0",
"rollup": "^2.3.4",
"rollup-plugin-css-only": "^3.1.0",
"rollup-plugin-livereload": "^2.0.0",
"rollup-plugin-svelte": "^7.0.0",
"rollup-plugin-terser": "^7.0.0",
"svelte": "^3.37.0"
},
"dependencies": {
"sirv-cli": "^1.0.0",
"sveltestrap": "^3.14.0"
}
我该怎么做才能做到这一点?:(
Svetestrap本身似乎存在问题。此处报告并解决:
GitHub发布
现在,它按预期工作。