@gridsheet/vue-core
@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 managementinitialCells- Initial cell data with values, styles, and formulasoptions- GridSheet options (e.g., mode: 'dark')sheetName- Name of the sheetsheetRef- Ref object to access sheet handlestoreRef- Ref object to access store handleclassName- CSS class namestyle- 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 componentuseBook- 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
@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
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 | |
| 3.4.3 | ^3.3.0 | Apache-2.0 | |
| 3.4.2 | ^3.3.0 | Apache-2.0 | |
| 3.4.1 | ^3.3.0 | Apache-2.0 | |
| 3.4.0 | ^3.3.0 | Apache-2.0 | |
| 3.3.0 | ^3.3.0 | Apache-2.0 | |
| 3.2.0 | ^3.3.0 | Apache-2.0 | |
| 3.1.0 | ^3.3.0 | Apache-2.0 | |
| 3.0.7 | ^3.3.0 | Apache-2.0 | |
| 3.0.6 | ^3.3.0 | Apache-2.0 | |
| 3.0.5 | ^3.3.0 | Apache-2.0 | |
| 3.0.4 | ^3.3.0 | Apache-2.0 | |
| 3.0.3 | ^3.3.0 | Apache-2.0 | |
| 3.0.2 | ^3.3.0 | Apache-2.0 | |
| 3.0.1 | ^3.3.0 | Apache-2.0 | |
| 0.1.0 | ^3.3.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 | |
| 2.0.5-0 | ^3.3.0 | Apache-2.0 | |
| 2.0.4-0 | ^3.3.0 | Apache-2.0 | |
| 2.0.3-0 | ^3.3.0 | Apache-2.0 | |
| 2.0.2-0 | ^3.3.0 | Apache-2.0 | |
| 2.0.1-0 | ^3.3.0 | Apache-2.0 | |
| 2.0.0-rc.7-0 | ^3.3.0 | Apache-2.0 | |
| 2.0.0-rc.5-1 | ^3.3.0 | Apache-2.0 | |
| 2.0.0-rc.5-0 | ^3.3.0 | Apache-2.0 | |
| 2.0.0-0 | ^3.3.0 | Apache-2.0 | |
| 2.0.0-0.rc.2 | ^3.3.0 | Apache-2.0 | |
| 2.0.0-0.rc.0 | ^3.3.0 | Apache-2.0 |