最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

svelte - Sveltestrap's modal header is not rendered correctly - Stack Overflow

programmeradmin2浏览0评论

i'm a svelte beginner.

I try to build a simple modal with Sveltestrap, but my modal is not rendered correctly. It always showing following text within modal instead of header:

(node, ...args) => { var previous_component_function = dev_current_component_function; set_dev_current_component_function(component2); try { return fn(node, ...args); } finally { set_dev_current_component_function(previous_component_function); } }

My Code looks like that:

<script lang="ts">
    import { Modal, ModalFooter, Button } from "@sveltestrap/sveltestrap";
    
    let {open = $bindable()}:{
        open: boolean
    } = $props();
    const toggle = () => (open = !open);
</script>

<Modal body header="Demo Modal" isOpen={open} {toggle}>

    <ModalFooter>
        <Button color="primary" on:click={toggle}>Hinzufügen</Button>
        <Button color="secondary" on:click={toggle}>Abbrechen</Button>
    </ModalFooter>
</Modal>

Any help would be appreciate.

regards

i'm a svelte beginner.

I try to build a simple modal with Sveltestrap, but my modal is not rendered correctly. It always showing following text within modal instead of header:

(node, ...args) => { var previous_component_function = dev_current_component_function; set_dev_current_component_function(component2); try { return fn(node, ...args); } finally { set_dev_current_component_function(previous_component_function); } }

My Code looks like that:

<script lang="ts">
    import { Modal, ModalFooter, Button } from "@sveltestrap/sveltestrap";
    
    let {open = $bindable()}:{
        open: boolean
    } = $props();
    const toggle = () => (open = !open);
</script>

<Modal body header="Demo Modal" isOpen={open} {toggle}>

    <ModalFooter>
        <Button color="primary" on:click={toggle}>Hinzufügen</Button>
        <Button color="secondary" on:click={toggle}>Abbrechen</Button>
    </ModalFooter>
</Modal>

Any help would be appreciate.

regards

Share Improve this question asked 2 days ago marky8264marky8264 331 silver badge6 bronze badges 1
  • I do not see that. Please provide a complete, minimal reproduction. – brunnerh Commented 2 days ago
Add a comment  | 

1 Answer 1

Reset to default 0

i found the cause of my problem.

npm installed an old version of sveltestrap.

So i uninstalled and reinstalled the package. Now it works without any problem.

发布评论

评论列表(0)

  1. 暂无评论