mirror of
https://github.com/centau/vide.git
synced 2026-08-20 14:41:37 +00:00
Refactor components section in 3-components.md
Updated the components section to improve formatting and clarity.
This commit is contained in:
parent
c247a2eeb2
commit
0e9fc76e5b
1 changed files with 13 additions and 20 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
<img width="239" height="496" alt="image" src="https://github.com/user-attachments/assets/2d5de615-60bc-4e1b-997f-ec1cac69c8df" /># Components
|
# Components
|
||||||
|
|
||||||
Vide encourages separating different parts of your UI into functions called
|
Vide encourages separating different parts of your UI into functions called
|
||||||
*components*.
|
*components*.
|
||||||
|
|
@ -32,9 +32,6 @@ local function Button(props: {
|
||||||
end
|
end
|
||||||
|
|
||||||
return Button
|
return Button
|
||||||
```
|
|
||||||
|
|
||||||
```luau [Menu.luau]
|
|
||||||
local create = vide.create
|
local create = vide.create
|
||||||
local source = vide.source
|
local source = vide.source
|
||||||
local effect = vide.effect
|
local effect = vide.effect
|
||||||
|
|
@ -115,8 +112,6 @@ local function Menu()
|
||||||
end
|
end
|
||||||
|
|
||||||
return Menu
|
return Menu
|
||||||
```
|
|
||||||
```luau [slider.luau]
|
|
||||||
-- Example of a component that wraps the built-in slider component.
|
-- Example of a component that wraps the built-in slider component.
|
||||||
-- This keeps a consistent "component(props) -> Instance" style.
|
-- This keeps a consistent "component(props) -> Instance" style.
|
||||||
|
|
||||||
|
|
@ -165,5 +160,3 @@ end
|
||||||
|
|
||||||
return Slider
|
return Slider
|
||||||
:::
|
:::
|
||||||
|
|
||||||
A single parameter `props` is used to pass properties to the component.
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue