网页
综合
更新时间 2026-11-14 09:26:56
index - @campfire/core - JSR
自动蜘蛛
jsr.io
正文约 2993 字
Lightweight library that works with vanilla DOM elements and provides fine-grained reactivity + utils for building websites.
CfDom provides a configurable interface for core DOM operations.
Add event listener with SSR protection This is one of the few element methods we keep as it has special SSR handling
Configure the shim with custom DOM implementation.
Initialize the shim by attempting to detect browser environment. If in a browser, use the native DOM objects; otherwise, leave them unset.
Check if code is running in a browser environment. This can be useful for conditional logic based on environment.
Check if DOM shim is using a custom (non-browser) implementation.
Reactive store for arrays, with ergonomic mutation helpers and eventing.
Sets the store's value to an empty array and triggers a 'clear' event.
Retrieves the element at the specified index.
Utility accessor to find the length of the store.
Appends a new element to the end of the list.
Removes the element at the specified index.
Sets the value of an element at a specific index.
Reactive store for string-keyed maps, with fast lookup, granular change events, and ergonomic transform/clear/has/entries helpers.
Removes all key-value pairs from the store.
Retrieves the value associated with a specific key.
Removes a key-value pair from the store.
Sets a value for a specific key in the store.
Applies a transformation function to the value of a specific key.
Builder class for creating and configuring HTML elements using a fluent API.
Sets a single attribute on the element.
Sets multiple attributes on the element at once.
Mount reactive children into a parent element. The children are preserved across re-renders and can be independently reactive.
Set a class name. Pass on with a falsy value to not apply the class.
Sets the content of the element as a string, escaped by default. Useful for quick and safe interpolation of strings into DOM content.
Finalizes the builder and creates the actual DOM element with all configured properties.
Specifies selectors for elements that should be retrieved after building the element.
Like gimme(), but retrieves every element matching each selector.
Unsafely set the html of the object. This is equivalent to calling .content(...).raw(true) and is meant to be used with a templating function like cf.html.
Appends one or more elements as children of the element being built.
Sets miscellaneous properties on the element (e.g. input.checked).
Attaches an event handler to the element.
Element properties configuration object
Sets whether the content value should be treated as raw HTML.
Sets a render function that will be called to generate content whenever dependencies change.
Sets a single CSS style property on the element.
Sets multiple CSS style properties on the element at once.
Mark the element for tracking, so it can be retrieved later by calling cf.tracked(id).
The primitive observable container. Store is the base class for all reactive state in Campfire.
本页为82搜索生成的网页快照,内容来自站内索引;演示数据的原文链接仅作示例。