Socket
Book a DemoInstallSign in
Socket

@y-block/array

Package Overview
Dependencies
Maintainers
0
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@y-block/array

### Properties

latest
npmnpm
Version
1.0.0
Version published
Maintainers
0
Created
Source

y-array

Properties

PropertyTypeDescription
arrayY.Arraydefines the array for the componnet

Slots

TypeDescription
ChildNodeThe item template

Examples

Basic Example

If you have an array of strings like this:

doc.getArray('my-array').insert(0, ["Hello", "Array!"])

You can create a component like this:

<y-array array="doc.getArray('my-array')">
    <input $:placeholder="item" />
</y-array>

Object Example

If you have an array of objects like this:

doc.getArray('my-array').insert(0, [
    {firstName: "Hello", lastName:"Array!", style:{padding: "5px", margin: "5px"}},
    {firstName: "So", lastName:"Sweet!", style:{padding: "5px", margin: "5px"}}
])

You can create a component like this:

<y-array array="doc.getArray('my-array')">
    <input $:placeholder="firstName" $:style="style" />
    <input $:placeholder="lastName"  $:style="style" />
</y-array>

FAQs

Package last updated on 01 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts