宜搭开发包
    正在准备搜索索引...

    类 CSSBuilder

    CSS 构建器

    • 适用于需要动态构建 CSS 样式字符串的场景
    • 提供链式调用接口,便于逐步添加样式属性
    • 内置 from 方法,支持从普通对象创建 CSSBuilder 实例

    层级

    • Map<string, string>
      • CSSBuilder
    索引

    构造函数

    • 参数

      • 可选entries: readonly (readonly [string, string])[] | null

      返回 CSSBuilder

    • 参数

      • 可选iterable: Iterable<readonly [string, string], any, any> | null

      返回 CSSBuilder

    属性

    "[toStringTag]": string
    size: number

    the number of elements in the Map.

    "[species]": MapConstructor

    方法

    • Returns an iterable of entries in the map.

      返回 MapIterator<[string, string]>

    • Removes all elements from the Map.

      返回 void

    • 参数

      • key: string

      返回 boolean

      true if an element in the Map existed and has been removed, or false if the element does not exist.

    • Returns an iterable of key, value pairs for every entry in the map.

      返回 MapIterator<[string, string]>

    • Executes a provided function once per each key/value pair in the Map, in insertion order.

      参数

      • callbackfn: (value: string, key: string, map: Map<string, string>) => void
      • 可选thisArg: any

      返回 void

    • Returns a specified element from the Map object. If the value that is associated to the provided key is an object, then you will get a reference to that object and any change made to that object will effectively modify it inside the Map.

      参数

      • key: string

      返回 string | undefined

      Returns the element associated with the specified key. If no element is associated with the specified key, undefined is returned.

    • 参数

      • key: string

      返回 boolean

      boolean indicating whether an element with the specified key exists or not.

    • Returns an iterable of keys in the map

      返回 MapIterator<string>

    • Adds a new element with a specified key and value to the Map. If an element with the same key already exists, the element will be updated.

      参数

      • key: string
      • value: string

      返回 this

    • 将 CSSBuilder 中的样式属性和值转换为 CSS 样式字符串

      返回 string

    • Returns an iterable of values in the map

      返回 MapIterator<string>

    • 从给定的键值对对象创建一个新的 CSSBuilder 实例

      参数

      • source: Record<string, string>

        包含 CSS 属性和对应值的对象

      返回 CSSBuilder

    • Groups members of an iterable according to the return value of the passed callback.

      类型参数

      • K
      • T

      参数

      • items: Iterable<T>

        An iterable.

      • keySelector: (item: T, index: number) => K

        A callback which will be invoked for each item in items.

      返回 Map<K, T[]>