GithubHelp home page GithubHelp logo

Support req about svelma HOT 5 CLOSED

c0bra avatar c0bra commented on August 23, 2024
Support req

from svelma.

Comments (5)

mihaimiculescu avatar mihaimiculescu commented on August 23, 2024 1

Actually it was a doc glitch ...
The demo code from https://c0bra.github.io/svelma/components/dialog - first example uses Toast too:

  import { Button, Dialog } from 'svelma'

...

const thenHandler = result =>Toast.create(`You ${result ? 'confirmed' : 'canceled'}`)

etc
So, the import line for the first example should read
import { Button, Dialog, Toast } from 'svelma'
Otherwise, it generates errors.
Silly me - I could have noticed beforehand ... sry

Could you please fix the doc?

from svelma.

rohfle avatar rohfle commented on August 23, 2024

Either of these ways should work

import { Button } from 'svelma/src/index.js';
import Button from 'svelma/src/components/Button.svelte';

Also see pull request #31 which should allow you to just import components directly when its merged

from svelma.

mihaimiculescu avatar mihaimiculescu commented on August 23, 2024

Thanks for the reply.
The Button line works OK. I already had tried it.
The problem is with the Dialog line.
I tried to replace

import { Button, Dialog } from 'svelma';

with

import Button from 'svelma/src/components/Button.svelte';
import Dialog from 'svelma/src/components/Dialog';

but the Dialog line is problematic. Even if I put

import Dialog from 'svelma/src/components/Dialog/Dialog.svelte';

I still get errors.

from svelma.

rohfle avatar rohfle commented on August 23, 2024
import Dialog from 'svelma/src/components/Dialog';

and the demo code from the docs works for me on Svelma 0.3.0... I'm not using Sapper though...

What do the errors say?

from svelma.

c0bra avatar c0bra commented on August 23, 2024

Done, thanks for finding this!

from svelma.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.