|
14 | 14 | }, |
15 | 15 | { |
16 | 16 | "title": "এসভেল্ট এর সাধারণ বিষয়াবলি", |
17 | | - "items": [{ |
18 | | - "definition": "ভ্যারিয়েবল ডিক্লেয়ার", |
19 | | - "code": "<script> \n let name = 'world'; \n</script> \n<h1>Hello {name}!</h1>" |
| 17 | + "items": |
| 18 | + [ |
| 19 | + { |
| 20 | + "definition": "এসভেল্ট এ 'Hello world' প্রিন্ট করা", |
| 21 | + "code": "//App.svelte\n\n<h1>Hello world!</h1>" |
| 22 | + }, |
| 23 | + { |
| 24 | + "definition": "ডাটা যুক্ত করা(ভ্যারিয়েবল ডিক্লেয়ার)", |
| 25 | + "code": "//App.svelte\n\n<script> \n let name = 'world';\n</script> \n\n<h1>Hello {name}!</h1>" |
20 | 26 | }, |
21 | 27 | { |
22 | 28 | "definition": "ডায়ন্যামিক অ্যাট্রিবিউট", |
23 | | - "code": "<script> \n let src = 'tutorial/image.gif', widht='100', height='100'; \n</script> \n<img {src} {width} {height}>" |
| 29 | + "code": "//App.svelte\n\n<script> \n let src = 'tutorial/image.gif', widht='100', height='100';\n</script> \n\n<img {src} {width} {height}>" |
24 | 30 | }, |
25 | 31 | { |
26 | 32 | "definition": "কম্পোনেন্ট স্ট্যাইল", |
27 | | - "code": "\n<p>This is a paragraph.</p>\n<style>\np{\n\tcolor: purple;\n}\n</style>" |
| 33 | + "code": "//App.svelte\n\n<p>This is a paragraph.</p>\n\n<style>\n p{\n color: purple;\n }\n</style>" |
28 | 34 | }, |
29 | 35 | { |
30 | 36 | "definition": "নেস্টেড কম্পোনেন্ট", |
31 | 37 | "code": [ |
32 | | - "\n//App.svelte \n<script>\n\t import ChildComponent from './Child.svelte'; \n</script> \n<h2>I'm Parent Component</h2> \n<ChildComponent/> \n", |
33 | | - "\n//Child.svelte \n <h2>I'm Child Component</h2>" |
| 38 | + "//App.svelte\n\n<script>\n import NestedComponent from './Nested.svelte'; \n</script>\n\n<h2>I'm Parent Component</h2> \n<NestedComponent/> \n", |
| 39 | + "\n//Nested.svelte \n\n<h2>I'm Nested Component</h2>" |
34 | 40 | ] |
35 | 41 | }, |
| 42 | + { |
| 43 | + "definition": "HTML ট্যাগস", |
| 44 | + "code": [ |
| 45 | + "//App.svelte\n\n<script>\n let string = `this string contains some <strong>HTML!!!</strong>`; \n</script>\n\n<h2><p>{@html string}</p></h2>\n" |
| 46 | + ] |
| 47 | + } |
| 48 | + ] |
| 49 | + }, |
| 50 | + { |
| 51 | + "title": "এসভেল্ট এর অন্যান্য বিষয়াবলি", |
| 52 | + "items": [ |
36 | 53 | { |
37 | 54 | "definition": "নেস্টেড কম্পোনেন্ট এ props পাঠানো", |
38 | 55 | "code": [ |
39 | | - "//App.svelte \n <script>\n import ChildComponent from './Child.svelte'; \n let title = 'I'm Child Component'; \n</script> \n <h2>I'm Parent Component</h2> \n <ChildComponent {title}/> \n", |
40 | | - "\n//Child.svelte \n <script> \n export let title; \n</script> \n<h2>{title || 'Hello world'}</h2>" |
| 56 | + "//App.svelte \n\n<script>\n import ChildComponent from './Child.svelte'; \n let title = 'I'm Child Component'; \n</script> \n\n<h2>I'm Parent Component</h2> \n<ChildComponent {title}/> \n", |
| 57 | + "\n// Child.svelte \n\n<script> \n export let title; \n</script> \n\n<h2>{title || 'Hello world'}</h2>" |
41 | 58 | ] |
42 | 59 | }, |
43 | 60 | { |
44 | 61 | "definition": "ডিফল্ট props", |
45 | 62 | "code": [ |
46 | | - "//App.svelte \n <script>\n import ChildComponent from './Child.svelte'; \n let title = 'I'm Child Component'; \n</script> \n <h2>I'm Parent Component</h2> \n", |
47 | | - "<ChildComponent {title}/> \n <ChildComponent/> \n", |
48 | | - "\n//Child.svelte \n <script> \n export let title = 'Hello world'; \n</script> \n<h2>{title}</h2>" |
| 63 | + "//App.svelte \n\n<script>\n import ChildComponent from './Child.svelte'; \n let title = 'I'm Child Component'; \n</script> \n\n<h2>I'm Parent Component</h2> \n", |
| 64 | + "<ChildComponent {title}/> \n<ChildComponent/> \n", |
| 65 | + "\n//Child.svelte \n\n<script> \n export let title = 'Hello world'; \n</script> \n\n<h2>{title}</h2>" |
49 | 66 | ] |
50 | 67 | }, |
51 | 68 | { |
52 | 69 | "definition": "ইভেন্ট হ্যান্ডেলার", |
53 | 70 | "code": [ |
54 | | - "<script> \n let count = 0; \n function incrementCount() { \n\t count += 1; \n } \n</script>\n", |
| 71 | + "<script> \n let count = 0; \n function incrementCount() { \n count += 1; \n } \n</script>\n\n", |
55 | 72 | "<button on:click={incrementCount}> Clicked {count} {count === 1 ? 'time' : 'times'}</button>" |
56 | 73 | ] |
57 | 74 | }, |
58 | 75 | { |
59 | 76 | "definition": "রিয়্যাক্টিভ অ্যাসাইনমেন্ট", |
60 | 77 | "code": [ |
61 | | - "<script> \n let count = 0; \n $: doubled = count * 2; \n function incrementCount() { \n\t count += 1; \n } \n</script>\n", |
| 78 | + "<script> \n let count = 0; \n $: doubled = count * 2; \n function incrementCount() { \n count += 1; \n } \n</script>\n\n", |
62 | 79 | "<button on:click={incrementCount}> Clicked {count} {count === 1 ? 'time' : 'times'}</button>\n", |
63 | 80 | "<p>{count} doubled is {doubled}</p>" |
64 | 81 | ] |
65 | 82 | }, |
66 | 83 | { |
67 | 84 | "definition": "রিয়্যাক্টিভ লজিক", |
68 | 85 | "code": [ |
69 | | - "<script>\n let x = 7;\n </script>\n", |
| 86 | + "<script>\n let x = 7;\n</script>\n\n", |
70 | 87 | "{#if x > 10}\n <p>{x} is greater than 10</p> \n {:else if 5 > x}\n <p>{x} is less than 5</p> \n {:else}\n <p>{x} is between 5 and 10</p>\n {/if}\n" |
71 | 88 | ] |
72 | 89 | }, |
73 | 90 | { |
74 | 91 | "definition": "লজিক", |
75 | 92 | "code": [ |
76 | | - "<script> \n let count = 0; \n $: if (count >= 10) { \n alert(`count is dangerously high!`); \n count = 9; \n} \n function incrementCount() { \n count += 1; \n } \n</script>\n", |
| 93 | + "<script> \n let count = 0; \n $: if (count >= 10) { \n alert(`count is dangerously high!`); \n count = 9; \n} \n function incrementCount() { \n count += 1; \n } \n</script>\n\n", |
77 | 94 | "<button on:click={incrementCount}> Clicked {count} {count === 1 ? 'time' : 'times'}</button>\n" |
78 | 95 | ] |
79 | 96 | }, |
80 | 97 | { |
81 | 98 | "definition": "লুপ", |
82 | 99 | "code": [ |
83 | | - "<script> \n let cats = [ { id: 'J---aiyznGQ', name: 'Keyboard Cat' }, { id: 'z_AbfPXTKms', name: 'Maru' }, { id: 'OUtn3pvWmpg', name: 'Henri The Existential Cat' } ]; \n</script> \n", |
| 100 | + "<script> \n let cats = [{ \n\tid: 'J---aiyznGQ', name: 'Keyboard Cat' }, \n\t{ id: 'z_AbfPXTKms', name: 'Maru' },\n\t{ id: 'OUtn3pvWmpg', name: 'Henri The Existential Cat' }]; \n</script> \n\n", |
84 | 101 | "<h1>The Famous Cats of YouTube</h1>\n", |
85 | | - "{#each cats as { id, name }, i} \n <div> \n <a target='_blank' href='https: //www.youtube.com/watch?v={id}'>{i + 1}: {name}</a> \n </div> \n {/each}" |
| 102 | + "{#each cats as { id, name }, i} \n <div> \n <a target='_blank' href='https: //www.youtube.com/watch?v={id}'>{i + 1}: {name}</a> \n </div> \n{/each}" |
86 | 103 | ] |
87 | 104 | }, |
88 | 105 | { |
89 | 106 | "definition": "ডম ইভেন্ট হ্যান্ডেলার", |
90 | 107 | "code": [ |
91 | | - "<script> \n let m = { x: 0, y: 0 }; \n function handleMousemove(event) { \n m.x = event.clientX; \n m.y = event.clientY; \n } \n </script> \n", |
92 | | - "<div on:mousemove={handleMousemove}> \n The mouse position is {m.x} x {m.y} \n </div> \n", |
93 | | - "<style> \n div { \n width: 100%; \n height: 100%; \n } \n</style>" |
| 108 | + "<script> \n let m = { x: 0, y: 0 }; \n function handleMousemove(event) { \n m.x = event.clientX; \n m.y = event.clientY; \n } \n</script> \n\n", |
| 109 | + "<div on:mousemove={handleMousemove}> \n The mouse position is {m.x} x {m.y} \n</div> \n\n", |
| 110 | + "<style> \n div { \n width: 100%; \n height: 100%; \n } \n</style>" |
94 | 111 | ] |
95 | 112 | }, |
96 | 113 | { |
97 | 114 | "definition": "ইনলাইন ডম ইভেন্ট হ্যান্ডেলার", |
98 | 115 | "code": [ |
99 | | - "<script> \n let m = { x: 0, y: 0 }; \n </script> \n", |
100 | | - "<div on:mousemove='{e => m = { x: e.clientX, y: e.clientY}}'> \n The mouse position is {m.x} x {m.y} \n </div> \n", |
101 | | - "<style> \n div { \n width: 100%; \n height: 100%; \n } \n</style>" |
| 116 | + "<script> \n let m = { x: 0, y: 0 }; \n</script> \n\n", |
| 117 | + "<div on:mousemove='{e => m = { x: e.clientX, y: e.clientY}}'> \n The mouse position is {m.x} x {m.y} \n</div> \n\n", |
| 118 | + "<style> \n div { \n width: 100%; \n height: 100%;\n } \n</style>" |
102 | 119 | ] |
103 | 120 | }, |
104 | 121 | { |
105 | 122 | "definition": "কম্পোনেন্ট ইভেন্টস", |
106 | 123 | "code": [ |
107 | 124 | "//App.svelte ", |
108 | | - "\n <script> \n import Inner from './Inner.svelte'; \n function handleMessage(event) { \n alert(event.detail.text); \n } \n </script> \n", |
| 125 | + "\n\n<script> \n import Inner from './Inner.svelte'; \n function handleMessage(event) { \n alert(event.detail.text); \n } \n</script> \n\n", |
109 | 126 | "<Inner on:message={handleMessage}/>", |
110 | 127 | "\n\n//Inner.svelte", |
111 | | - "\n <script> \n import { createEventDispatcher } from 'svelte'; \n const dispatch = createEventDispatcher(); \n ", |
112 | | - "function sayHello() { \n dispatch('message', { \n\t text: 'Hello!'}); \n } \n </script> \n", |
| 128 | + "\n\n<script> \n import { createEventDispatcher } from 'svelte'; \n const dispatch = createEventDispatcher(); \n ", |
| 129 | + " function sayHello() { \n dispatch('message', {text: 'Hello!'}); \n } \n </script> \n\n", |
113 | 130 | "<button on:click={sayHello}> Click to say hello </button>" |
114 | 131 | ] |
115 | 132 | }, |
|
170 | 187 | "items": [{ |
171 | 188 | "definition": "রাইটেবল(writable)", |
172 | 189 | "code": [ |
173 | | - "import { writable } from 'svelte/store';\n\nconst count = writable(0);\ncount.subscribe(value => {\n\tconsole.log(value);\n}); // logs '0'\ncount.set(1);\ncount.set(1); // logs '1'\ncount.update(n => n + 1); // logs '2'" |
| 190 | + "import { writable } from 'svelte/store';\n\nconst count = writable(0);\ncount.subscribe(value => {\n\tconsole.log(value);\n}); // logs '0'\n\ncount.set(1); // logs '1'\ncount.update(n => n + 1); // logs '2'" |
174 | 191 | ] |
175 | 192 | }, |
176 | 193 | { |
|
0 commit comments