Univer
Univer Sheet
Features
Data Validation

Data Validation

📊 Univer Sheet

Data validation is a feature that sets rules in cells to ensure that the data entered by users meets specific conditions.

Installation

pnpm add @univerjs/data-validation @univerjs/sheets-data-validation

Import

import '@univerjs/sheets-data-validation/lib/index.css';
 
import { UniverDataValidationPlugin } from '@univerjs/data-validation';
import { UniverSheetsDataValidationPlugin } from '@univerjs/sheets-data-validation';

Internationalization

import { LocaleType, Tools } from '@univerjs/core';
import SheetsDataValidationEnUS from '@univerjs/sheets-data-validation/locale/en-US';
 
const univer = new Univer({
  theme: defaultTheme,
  locale: LocaleType.EN_US,
  locales: {
    [LocaleType.EN_US]: Tools.deepMerge(
      SheetsDataValidationEnUS
    ),
  },
});

Register

univer.registerPlugin(UniverDataValidationPlugin);
univer.registerPlugin(UniverSheetsDataValidationPlugin);

Copyright © 2021-2024 DreamNum Co,Ltd. All Rights Reserved.