Skip to content

Commit 1611c9e

Browse files
authored
Merge pull request #52 from jasongitmail/patch-2
Update blueprint.md - Add Svelte usage example for ui-svg
2 parents 8f10624 + 8a200fb commit 1611c9e

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

packages/ui-svg/blueprint.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Run the following command from the root of your project:
1414

1515
For now only `vue` (and core) is supported.
1616

17+
### NativeScript + Vue
18+
1719
```ts
1820
import CanvasSVG from '@nativescript-community/ui-svg/vue';
1921
Vue.use(CanvasSVG);
@@ -47,10 +49,23 @@ Or within and Canvas View extending `CanvasView` like `CanvasLabel`
4749
</CanvasSVG>
4850
```
4951

52+
### NativeScript + Svelte
53+
54+
```ts
55+
// app/app.ts
56+
import { registerNativeViewElement } from 'svelte-native/dom';
57+
registerNativeViewElement('svgView', () => require('@nativescript-community/ui-svg').SVGView);
58+
```
59+
60+
```svelte
61+
<!-- app/components/Foo.svelte -->
62+
<svgView src="~/assets/foo.svg" aspectFit="stretch" />
63+
```
64+
5065
### Examples:
5166

5267
- [Basic](demo-snippets/vue/SVG.vue)
5368
- A basic SVG example
5469

5570
{{ load:../../tools/readme/demos-and-development.md }}
56-
{{ load:../../tools/readme/questions.md }}
71+
{{ load:../../tools/readme/questions.md }}

0 commit comments

Comments
 (0)