@gridsheet/vue-core

Spreadsheet component for Vue 3
4,566 198
Install
npm install @gridsheet/vue-core
Latest Version:3.6.0
Vue:3
License:Apache-2.0
Last Updated:Oct 21, 2026
Links: GitHub  ·  npm
Maintainer: righ

@gridsheet/vue-core

Spreadsheet component for Vue 3

Installation

npm install @gridsheet/vue-core @gridsheet/functions

Peer Dependencies

This package requires the following peer dependency:

  • vue ^3.3.0

Usage

<template>
  <main>
    <GridSheet
      :book="book"
      :initialCells="{
        A1: { value: 'Hello' },
        B1: { value: 'Vue', style: { backgroundColor: '#448888'} },
        A2: { value: 123 },
        B2: { value: 456 },
        A3: { value: 789},
        C6: { value: '=SUM(A2:B2)' },
      }"
      :options="{
        mode: 'dark',
      }"
      sheetName="Sheet1"
    />

    <GridSheet
      :book="book"
      :initialCells="{
        C3: { value: '=SUM(Sheet1!A2:B3)' },
      }"
      :options="{}"
      sheetName="Sheet2"
    />
  </main>
</template>

<script setup>
import { GridSheet } from '@gridsheet/vue-core';
import { useSpellbook } from '@gridsheet/vue-core/spellbook'; // requires @gridsheet/functions
const book = useSpellbook();
</script>

Components

GridSheet

The main spreadsheet component for Vue 3 applications.

Props:

  • book - Book object for cross-sheet data binding and state management
  • initialCells - Initial cell data with values, styles, and formulas
  • options - GridSheet options (e.g., mode: 'dark')
  • sheetName - Name of the sheet
  • sheetRef - Ref object to access sheet handle
  • storeRef - Ref object to access store handle
  • className - CSS class name
  • style - Inline styles

useSpellbook

Creates a reactive book with all extended functions (@gridsheet/functions) pre-loaded. Returns a shallowRef<BookType>.

import { useSpellbook } from '@gridsheet/vue-core/spellbook'; // requires @gridsheet/functions
const book = useSpellbook({ /* RegistryProps */ });

useBook

Same as useSpellbook but without extended functions.

import { useBook } from '@gridsheet/vue-core';
const book = useBook({ /* RegistryProps */ });

Exports

This package exports:

  • All core GridSheet functionality from @gridsheet/preact-core
  • GridSheet - Vue 3 component
  • useBook - Vue 3-specific reactive book composable
  • @gridsheet/vue-core/spellbook - useSpellbook, createSpellbook

Docs

Development

# Start development server
pnpm dev

# Build the package
pnpm build

License

Apache-2.0

Related Packages

@evansun/excel-designer

基于 Canvas + Vue 3 的在线 Excel 表格组件(单元格合并、行高列宽拖拽、公式引擎、...

1,691
@excel-report/vue

ExcelReport 前端预览组件的 Vue 3 适配层

0
@jspreadsheet/vue

Jspreadsheet is a lightweight, vanilla javascript plugin to create amazing web-b...

49,168
@jspreadsheet-ce/vue

Jspreadsheet CE is a lightweight, vanilla JavaScript plugin for creating powerfu...

29,243
gridjs-vue

A Vue.js wrapper component for Grid.js

65,492 99

Version History

Version Released Vue License
3.6.0 ^3.3.0 Apache-2.0
3.5.2 ^3.3.0 Apache-2.0
3.5.1 ^3.3.0 Apache-2.0
3.5.0 ^3.3.0 Apache-2.0
3.4.4 ^3.3.0 Apache-2.0
Pre-releases (16)
Version Released Vue License
3.0.0-rc.13 ^3.3.0 Apache-2.0
3.0.0-rc.12 ^3.3.0 Apache-2.0
3.0.0-rc.11 ^3.3.0 Apache-2.0
2.2.0-0 ^3.3.0 Apache-2.0
2.1.0-0 ^3.3.0 Apache-2.0