0.0.1 • Published 4 years ago

pubs-my-svelte-component v0.0.1

Weekly downloads
5
License
-
Repository
-
Last release
4 years ago

pubs-my-svelte-component

comment: <> (packageVersion:0.0.1) comment: <> (packageName:pubs-my-svelte-component) comment: <> (componentName:MySvelteComponent)

MySvelteComponent is a vanilla javascript component which will work in any frontend framework. You can install from npm like this:

npm install --save pubs-my-svelte-component

Vanilla Javascript

Below you can see how to use the component with vanilla js.

...
<head>
    ...
    <script src="./node_module/pubs-my-svelte-component/index.js"></script>
</head>
<body>
    <script>
        new MySvelteComponent({target:document.body})
    </script>
</body>

ES module

<body>
    <script type="module">
        import MySvelteComponent from './node_module/pubs-my-svelte-component/index.mjs'
        new MySvelteComponent({target:document.body})
    </script>
</body>

Svelte Component

<script>
    import MySvelteComponent from 'pubs-my-svelte-component'
</script>
<MySvelteComponent/>