ICellData
The stored content and formatting of one cell. Use v for plain values, f for formulas, p for rich text, and s for styles. Pass cell data to FRange.setValue or setValues.
import type { ICellData } from '@univerjs/core'import { CellValueType } from '@univerjs/core'const amount: ICellData = { v: 42, t: CellValueType.NUMBER }const formula: ICellData = { f: '=SUM(A1:A5)' }const label: ICellData = { v: '00123', t: CellValueType.FORCE_STRING }Import
import type { ICellData } from '@univerjs/core'Definition
interface ICellData { p?: Nullable<IDocumentData> s?: Nullable<IStyleData | string> v?: Nullable<CellValue> t?: Nullable<CellValueType> f?: Nullable<string> ref?: Nullable<string> xf?: Nullable<string> si?: Nullable<string> custom?: CustomData}Fields
p
Optional · Nullable<IDocumentData>
Rich text stored as a document snapshot. Plain values use v instead.
s
Optional · Nullable<string | IStyleData>
An inline cell style or a style ID from IWorkbookData.styles.
v
Optional · Nullable<CellValue>
The plain cell value: a string, number, or boolean. Use null to clear the value.
t
Optional · Nullable<CellValueType>
The value type. Univer normally infers it; use CellValueType.FORCE_STRING to keep numeric-looking text as text.
f
Optional · Nullable<string>
A formula beginning with =, such as =SUM(A1:B4).
ref
Optional · Nullable<string>
If the formula is a formula array, this field is used to store the referencing range.
xf
Optional · Nullable<string>
New Excel formulas need to add prefixes for differentiation, e.g., _xlfn._xlws. _xlfn. _xlws. _xludf.
si
Optional · Nullable<string>
Id of the formula.
custom
Optional · CustomData
User stored custom fields.
Related types
Package: @univerjs/core · Type definitions
你觉得这篇文档如何?