[{"id":"b66f8b1e-cc14-4e89-9679-abd5687d283d","tags":[{"product":null,"links":null,"id":"9e117e35-984a-4c14-95ca-ef0ec7b9fb60","name":"\u65B0\u589E","color":"DarkGreen","productId":"098be112-50ec-44e4-b746-6bc8bf76af97"}]},{"id":"569bb90a-ea68-46c6-96f1-ab151c120714","tags":[{"product":null,"links":null,"id":"a2f84374-4a3f-4d22-96fd-765e9de495bf","name":"\u66F4\u65B0","color":"Coral","productId":"098be112-50ec-44e4-b746-6bc8bf76af97"}]},{"id":"5eb52f08-2d1a-4362-9ffc-4871bdc10f3f","tags":[{"product":null,"links":null,"id":"a2f84374-4a3f-4d22-96fd-765e9de495bf","name":"\u66F4\u65B0","color":"Coral","productId":"098be112-50ec-44e4-b746-6bc8bf76af97"}]},{"id":"341dd607-b97d-4d70-bde2-53acda6b6c95","tags":[{"product":null,"links":null,"id":"a2f84374-4a3f-4d22-96fd-765e9de495bf","name":"\u66F4\u65B0","color":"Coral","productId":"098be112-50ec-44e4-b746-6bc8bf76af97"}]},{"id":"05349273-414f-4208-9ea2-c4fc8f4ea2cb","tags":[{"product":null,"links":null,"id":"a2f84374-4a3f-4d22-96fd-765e9de495bf","name":"\u66F4\u65B0","color":"Coral","productId":"098be112-50ec-44e4-b746-6bc8bf76af97"}]},{"id":"86089f76-b778-4d52-821e-6f27de3df613","tags":[{"product":null,"links":null,"id":"9e117e35-984a-4c14-95ca-ef0ec7b9fb60","name":"\u65B0\u589E","color":"DarkGreen","productId":"098be112-50ec-44e4-b746-6bc8bf76af97"}]},{"id":"b81e4fd6-1fc5-43a0-a258-b6e16a5cbec6","tags":[{"product":null,"links":null,"id":"a2f84374-4a3f-4d22-96fd-765e9de495bf","name":"\u66F4\u65B0","color":"Coral","productId":"098be112-50ec-44e4-b746-6bc8bf76af97"}]},{"id":"8aa8ce31-43e4-438e-951f-241608435260","tags":[{"product":null,"links":null,"id":"a2f84374-4a3f-4d22-96fd-765e9de495bf","name":"\u66F4\u65B0","color":"Coral","productId":"098be112-50ec-44e4-b746-6bc8bf76af97"}]},{"id":"37343f41-6ec2-4c7e-b21d-2cc18d5ce1e0","tags":[{"product":null,"links":null,"id":"a2f84374-4a3f-4d22-96fd-765e9de495bf","name":"\u66F4\u65B0","color":"Coral","productId":"098be112-50ec-44e4-b746-6bc8bf76af97"}]},{"id":"5915e52f-64f8-4146-b8bd-81bead6324a3","tags":[{"product":null,"links":null,"id":"a2f84374-4a3f-4d22-96fd-765e9de495bf","name":"\u66F4\u65B0","color":"Coral","productId":"098be112-50ec-44e4-b746-6bc8bf76af97"}]},{"id":"836ba889-af9e-460d-a4cc-c24d922795f2","tags":[{"product":null,"links":null,"id":"a2f84374-4a3f-4d22-96fd-765e9de495bf","name":"\u66F4\u65B0","color":"Coral","productId":"098be112-50ec-44e4-b746-6bc8bf76af97"}]},{"id":"4ae14b06-bb68-4394-a210-a46b8f028346","tags":[{"product":null,"links":null,"id":"a2f84374-4a3f-4d22-96fd-765e9de495bf","name":"\u66F4\u65B0","color":"Coral","productId":"098be112-50ec-44e4-b746-6bc8bf76af97"}]},{"id":"d8f42066-e9dc-4411-bdcf-43b1a203370c","tags":[{"product":null,"links":null,"id":"9e117e35-984a-4c14-95ca-ef0ec7b9fb60","name":"\u65B0\u589E","color":"DarkGreen","productId":"098be112-50ec-44e4-b746-6bc8bf76af97"}]},{"id":"7ef86f16-b1a0-49f7-9592-612b9be02b25","tags":[{"product":null,"links":null,"id":"a2f84374-4a3f-4d22-96fd-765e9de495bf","name":"\u66F4\u65B0","color":"Coral","productId":"098be112-50ec-44e4-b746-6bc8bf76af97"}]},{"id":"b29c7775-a9a4-451e-a1b5-01d19ed5ca5e","tags":[{"product":null,"links":null,"id":"9e117e35-984a-4c14-95ca-ef0ec7b9fb60","name":"\u65B0\u589E","color":"DarkGreen","productId":"098be112-50ec-44e4-b746-6bc8bf76af97"}]},{"id":"e56f3989-8f81-46af-90fa-a4813eeb976f","tags":[{"product":null,"links":null,"id":"9e117e35-984a-4c14-95ca-ef0ec7b9fb60","name":"\u65B0\u589E","color":"DarkGreen","productId":"098be112-50ec-44e4-b746-6bc8bf76af97"}]},{"id":"2526c963-f170-45a8-923e-91b0712a9810","tags":[{"product":null,"links":null,"id":"9e117e35-984a-4c14-95ca-ef0ec7b9fb60","name":"\u65B0\u589E","color":"DarkGreen","productId":"098be112-50ec-44e4-b746-6bc8bf76af97"}]},{"id":"24575cf0-501a-44f9-8426-c40f8f4b5552","tags":[{"product":null,"links":null,"id":"a2f84374-4a3f-4d22-96fd-765e9de495bf","name":"\u66F4\u65B0","color":"Coral","productId":"098be112-50ec-44e4-b746-6bc8bf76af97"}]},{"id":"1a6f8d7f-acd6-42be-8c4f-f464c6218381","tags":[{"product":null,"links":null,"id":"a2f84374-4a3f-4d22-96fd-765e9de495bf","name":"\u66F4\u65B0","color":"Coral","productId":"098be112-50ec-44e4-b746-6bc8bf76af97"}]},{"id":"82b176fd-5cab-498c-909e-8fa7d29c38d8","tags":[{"product":null,"links":null,"id":"9e117e35-984a-4c14-95ca-ef0ec7b9fb60","name":"\u65B0\u589E","color":"DarkGreen","productId":"098be112-50ec-44e4-b746-6bc8bf76af97"}]},{"id":"1708b3a9-4f37-44a8-8f0e-f9a2d2e5d940","tags":[{"product":null,"links":null,"id":"9e117e35-984a-4c14-95ca-ef0ec7b9fb60","name":"\u65B0\u589E","color":"DarkGreen","productId":"098be112-50ec-44e4-b746-6bc8bf76af97"}]},{"id":"c9ac246e-29fb-4bc4-8231-8439795bb590","tags":[{"product":null,"links":null,"id":"9e117e35-984a-4c14-95ca-ef0ec7b9fb60","name":"\u65B0\u589E","color":"DarkGreen","productId":"098be112-50ec-44e4-b746-6bc8bf76af97"}]},{"id":"94f2a5c3-2539-436a-af75-23fbbd1a3957","tags":[{"product":null,"links":null,"id":"a2f84374-4a3f-4d22-96fd-765e9de495bf","name":"\u66F4\u65B0","color":"Coral","productId":"098be112-50ec-44e4-b746-6bc8bf76af97"}]},{"id":"d99594f4-2d40-4df4-9419-ba2ca6aa3f7f","tags":[{"product":null,"links":null,"id":"9e117e35-984a-4c14-95ca-ef0ec7b9fb60","name":"\u65B0\u589E","color":"DarkGreen","productId":"098be112-50ec-44e4-b746-6bc8bf76af97"}]},{"id":"fd66e72d-0f10-4f57-9807-6db26290ab2e","tags":[{"product":null,"links":null,"id":"a2f84374-4a3f-4d22-96fd-765e9de495bf","name":"\u66F4\u65B0","color":"Coral","productId":"098be112-50ec-44e4-b746-6bc8bf76af97"}]},{"id":"8f344863-503d-4bc3-a594-3815e7d55f5c","tags":[{"product":null,"links":null,"id":"9e117e35-984a-4c14-95ca-ef0ec7b9fb60","name":"\u65B0\u589E","color":"DarkGreen","productId":"098be112-50ec-44e4-b746-6bc8bf76af97"}]},{"id":"9be82601-de9d-4c18-948a-23ab6f4dd431","tags":[{"product":null,"links":null,"id":"9e117e35-984a-4c14-95ca-ef0ec7b9fb60","name":"\u65B0\u589E","color":"DarkGreen","productId":"098be112-50ec-44e4-b746-6bc8bf76af97"}]},{"id":"6495f3c0-b463-47e0-b08a-ca949672211e","tags":[{"product":null,"links":null,"id":"9e117e35-984a-4c14-95ca-ef0ec7b9fb60","name":"\u65B0\u589E","color":"DarkGreen","productId":"098be112-50ec-44e4-b746-6bc8bf76af97"}]},{"id":"b4bede08-3f08-4839-ba4a-abc7ac195bde","tags":[{"product":null,"links":null,"id":"9e117e35-984a-4c14-95ca-ef0ec7b9fb60","name":"\u65B0\u589E","color":"DarkGreen","productId":"098be112-50ec-44e4-b746-6bc8bf76af97"}]},{"id":"4afcdfc0-3ff5-4f2b-a223-f8fc042a5bbe","tags":[{"product":null,"links":null,"id":"9e117e35-984a-4c14-95ca-ef0ec7b9fb60","name":"\u65B0\u589E","color":"DarkGreen","productId":"098be112-50ec-44e4-b746-6bc8bf76af97"}]},{"id":"422062c4-fa40-4771-a86f-008efe6d86e5","tags":[{"product":null,"links":null,"id":"9e117e35-984a-4c14-95ca-ef0ec7b9fb60","name":"\u65B0\u589E","color":"DarkGreen","productId":"098be112-50ec-44e4-b746-6bc8bf76af97"}]},{"id":"d87e8013-86a7-4840-8d25-6f62e14eb4ac","tags":[{"product":null,"links":null,"id":"9e117e35-984a-4c14-95ca-ef0ec7b9fb60","name":"\u65B0\u589E","color":"DarkGreen","productId":"098be112-50ec-44e4-b746-6bc8bf76af97"}]},{"id":"a6acedfd-4043-4c64-a5d1-aec3326df9e7","tags":[{"product":null,"links":null,"id":"9e117e35-984a-4c14-95ca-ef0ec7b9fb60","name":"\u65B0\u589E","color":"DarkGreen","productId":"098be112-50ec-44e4-b746-6bc8bf76af97"}]},{"id":"dbdc0b24-06c4-48b9-8d6c-7455119dc773","tags":[{"product":null,"links":null,"id":"9e117e35-984a-4c14-95ca-ef0ec7b9fb60","name":"\u65B0\u589E","color":"DarkGreen","productId":"098be112-50ec-44e4-b746-6bc8bf76af97"}]},{"id":"a3856849-954a-4cfc-96a6-382e530d3638","tags":[{"product":null,"links":null,"id":"a2f84374-4a3f-4d22-96fd-765e9de495bf","name":"\u66F4\u65B0","color":"Coral","productId":"098be112-50ec-44e4-b746-6bc8bf76af97"}]},{"id":"4a39306b-ffa5-433d-80a3-28e41f929b72","tags":[{"product":null,"links":null,"id":"a2f84374-4a3f-4d22-96fd-765e9de495bf","name":"\u66F4\u65B0","color":"Coral","productId":"098be112-50ec-44e4-b746-6bc8bf76af97"}]}]
        
(Showing Draft Content)

SpreadJS 独立模块

SpreadJS 模块可以在NPM上获得。许多现代的 JavaScript 构建工具和打包工具(如Webpack、Rollup、ESBuild和Vite)与 SpreadJS 的 NPM 包(包括模块、插件和资源)无缝协同工作。

此外,将SpreadJS整合到项目的构建过程中非常顺利,并且可以充分利用这些工具的功能。

在使用 SpreadJS 与单独模块时,请参考以下主题列表:

安装命令

以下命令用于安装在 NPM 上可用的模块:

@grapecity-software/spread-common
@grapecity-software/spread-calc-engine
@grapecity-software/spread-calc-engine-basic-functions
@grapecity-software/spread-calc-engine-advanced-functions
@grapecity-software/data-manager
@grapecity-software/spread-sheets-core
@grapecity-software/spread-sheets-bindings
@grapecity-software/spread-sheets-cell-types
@grapecity-software/spread-sheets-sparklines
@grapecity-software/spread-sheets-search
@grapecity-software/spread-sheets-outlines
@grapecity-software/spread-sheets-floating-objects
@grapecity-software/spread-sheets-comments
@grapecity-software/spread-sheets-tables
@grapecity-software/spread-sheets-touch
@grapecity-software/spread-sheets-conditional-formatting
@grapecity-software/spread-sheets-cell-state
@grapecity-software/spread-sheets-data-validation
@grapecity-software/spread-sheets-filter
@grapecity-software/spread-sheets-fill
@grapecity-software/spread-sheets-context-menu
@grapecity-software/spread-sheets-formula-textbox
@grapecity-software/spread-sheets-outline-column
@grapecity-software/spread-sheets-drag-merge
@grapecity-software/spread-sheets-statusbar
@grapecity-software/spread-sheets-auto-merge
@grapecity-software/spread-sheets-calc-engine
@grapecity-software/spread-sheets-hyperlink
@grapecity-software/spread-sheets-namebox
@grapecity-software/spread-sheets-input-mask

您可以与插件和资源一起使用这些模块。为此,您需要在构建工具或 CLI 中配置一个从“@grapecity-software/spread-sheets”到“@grapecity-software/spread-common”的别名。

type=warning

注意:“@grapecity-software/spread-sheets”是包含这些个别节点模块(“@grapecity-software/spread-common”...)的单一模块,它们不应该同时使用,因为可能会导致一些未知错误。

依赖表

模块内部的依赖关系

以下表格显示了模块内的最小依赖关系。

Packages

Dependencies

@grapecity-software/spread-sheets-languagepackages

@grapecity-software/spread-common

@grapecity-software/spread-calc-engine

@grapecity-software/spread-sheets-io

@grapecity-software/spread-common

@grapecity-software/spread-sheets-core

@grapecity-software/spread-sheets-charts

@grapecity-software/spread-common

@grapecity-software/spread-calc-engine

@grapecity-software/spread-sheets-core

@grapecity-software/spread-sheets-calc-engine

@grapecity-software/spread-sheets-floating-objects

@grapecity-software/spread-sheets-shapes

@grapecity-software/spread-common

@grapecity-software/spread-calc-engine

@grapecity-software/spread-sheets-core

@grapecity-software/spread-sheets-calc-engine

@grapecity-software/spread-sheets-floating-objects

@grapecity-software/spread-sheets-barcode

@grapecity-software/spread-common

@grapecity-software/spread-calc-engine

@grapecity-software/spread-sheets-core

@grapecity-software/spread-sheets-calc-engine

@grapecity-software/spread-sheets-sparklines

@grapecity-software/spread-sheets-print

@grapecity-software/spread-common

@grapecity-software/spread-calc-engine

@grapecity-software/spread-sheets-core

@grapecity-software/spread-sheets-calc-engine

@grapecity-software/spread-sheets-pdf

@grapecity-software/spread-common

@grapecity-software/spread-calc-engine

@grapecity-software/spread-sheets-core

@grapecity-software/spread-sheets-calc-engine

@grapecity-software/spread-sheets-print

@grapecity-software/spread-sheets-slicers

@grapecity-software/spread-common

@grapecity-software/spread-calc-engine

@grapecity-software/spread-sheets-core

@grapecity-software/spread-sheets-calc-engine

@grapecity-software/spread-sheets-floating-objects

@grapecity-software/spread-sheets-shapes

@grapecity-software/spread-sheets-conditional-formatting

@grapecity-software/spread-sheets-cell-types

@grapecity-software/spread-sheets-filter

@grapecity-software/spread-sheets-bindings

@grapecity-software/spread-sheets-outlines

@grapecity-software/spread-sheets-outline-column

@grapecity-software/spread-sheets-tables

@grapecity-software/spread-sheets-pivot-addon

@grapecity-software/spread-common

@grapecity-software/spread-calc-engine

@grapecity-software/spread-sheets-core

@grapecity-software/spread-sheets-calc-engine

@grapecity-software/spread-sheets-floating-objects

@grapecity-software/spread-sheets-shapes

@grapecity-software/spread-sheets-conditional-formatting

@grapecity-software/spread-sheets-cell-types

@grapecity-software/spread-sheets-filter

@grapecity-software/spread-sheets-bindings

@grapecity-software/spread-sheets-outlines

@grapecity-software/spread-sheets-outline-column

@grapecity-software/spread-sheets-tables

@grapecity-software/spread-sheets-slicers

@grapecity-software/spread-sheets-formula-textbox

@grapecity-software/spread-sheets-tablesheet

@grapecity-software/spread-common

@grapecity-software/spread-calc-engine

@grapecity-software/spread-sheets-core

@grapecity-software/spread-sheets-calc-engine

@grapecity-software/spread-sheets-conditional-formatting

@grapecity-software/spread-sheets-cell-types

@grapecity-software/spread-sheets-filter

@grapecity-software/spread-sheets-bindings

@grapecity-software/spread-sheets-outlines

@grapecity-software/spread-sheets-outline-column

@grapecity-software/spread-sheets-tables

@grapecity-software/spread-sheets-formula-textbox

@grapecity-software/spread-sheets-context-menu

@grapecity-software/spread-sheets-statusbar

@grapecity-software/data-manager

@grapecity-software/spread-sheets-auto-merge

@grapecity-software/spread-sheets-cell-state

@grapecity-software/spread-sheets-data-validation

插件内的依赖关系

下表显示了插件内部的最小依赖关系。

Packages

Dependencies

@grapecity-software/spread-sheets-languagepackages

@grapecity-software/spread-common

@grapecity-software/spread-calc-engine

@grapecity-software/spread-sheets-io

@grapecity-software/spread-common

@grapecity-software/spread-sheets-core

@grapecity-software/spread-sheets-charts

@grapecity-software/spread-common

@grapecity-software/spread-calc-engine

@grapecity-software/spread-sheets-core

@grapecity-software/spread-sheets-calc-engine

@grapecity-software/spread-sheets-floating-objects

@grapecity-software/spread-sheets-shapes

@grapecity-software/spread-common

@grapecity-software/spread-calc-engine

@grapecity-software/spread-sheets-core

@grapecity-software/spread-sheets-calc-engine

@grapecity-software/spread-sheets-floating-objects

@grapecity-software/spread-sheets-barcode

@grapecity-software/spread-common

@grapecity-software/spread-calc-engine

@grapecity-software/spread-sheets-core

@grapecity-software/spread-sheets-calc-engine

@grapecity-software/spread-sheets-sparklines

@grapecity-software/spread-sheets-print

@grapecity-software/spread-common

@grapecity-software/spread-calc-engine

@grapecity-software/spread-sheets-core

@grapecity-software/spread-sheets-calc-engine

@grapecity-software/spread-sheets-pdf

@grapecity-software/spread-common

@grapecity-software/spread-calc-engine

@grapecity-software/spread-sheets-core

@grapecity-software/spread-sheets-calc-engine

@grapecity-software/spread-sheets-print

@grapecity-software/spread-sheets-slicers

@grapecity-software/spread-common

@grapecity-software/spread-calc-engine

@grapecity-software/spread-sheets-core

@grapecity-software/spread-sheets-calc-engine

@grapecity-software/spread-sheets-floating-objects

@grapecity-software/spread-sheets-shapes

@grapecity-software/spread-sheets-conditional-formatting

@grapecity-software/spread-sheets-cell-types

@grapecity-software/spread-sheets-filter

@grapecity-software/spread-sheets-bindings

@grapecity-software/spread-sheets-outlines

@grapecity-software/spread-sheets-outline-column

@grapecity-software/spread-sheets-tables

@grapecity-software/spread-sheets-pivot-addon

@grapecity-software/spread-common

@grapecity-software/spread-calc-engine

@grapecity-software/spread-sheets-core

@grapecity-software/spread-sheets-calc-engine

@grapecity-software/spread-sheets-floating-objects

@grapecity-software/spread-sheets-shapes

@grapecity-software/spread-sheets-conditional-formatting

@grapecity-software/spread-sheets-cell-types

@grapecity-software/spread-sheets-filter

@grapecity-software/spread-sheets-bindings

@grapecity-software/spread-sheets-outlines

@grapecity-software/spread-sheets-outline-column

@grapecity-software/spread-sheets-tables

@grapecity-software/spread-sheets-slicers

@grapecity-software/spread-sheets-formula-textbox

@grapecity-software/spread-sheets-tablesheet

@grapecity-software/spread-common

@grapecity-software/spread-calc-engine

@grapecity-software/spread-sheets-core

@grapecity-software/spread-sheets-calc-engine

@grapecity-software/spread-sheets-conditional-formatting

@grapecity-software/spread-sheets-cell-types

@grapecity-software/spread-sheets-filter

@grapecity-software/spread-sheets-bindings

@grapecity-software/spread-sheets-outlines

@grapecity-software/spread-sheets-outline-column

@grapecity-software/spread-sheets-tables

@grapecity-software/spread-sheets-formula-textbox

@grapecity-software/spread-sheets-context-menu

@grapecity-software/spread-sheets-statusbar

@grapecity-software/data-manager

@grapecity-software/spread-sheets-auto-merge

@grapecity-software/spread-sheets-cell-state

@grapecity-software/spread-sheets-data-validation

资源内的依赖关系

以下表格显示了资源内的最小依赖关系。

Packages

Dependencies

@grapecity-software/spread-sheets-resources-ja

@grapecity-software/spread-common

@grapecity-software/spread-sheets-core

@grapecity-software/spread-sheets-resources-ko

@grapecity-software/spread-common

@grapecity-software/spread-sheets-core

@grapecity-software/spread-sheets-resources-zh

@grapecity-software/spread-common

@grapecity-software/spread-sheets-core

使用模块的示例代码

使用全局变量和核心模块

以下代码示例展示了如何使用核心模块和全局变量:

<!DOCTYPE html>
<html>
<head>
 <title>Test SJS Modules with Global Variable</title>
 <link rel="stylesheet" type="text/css"
 href="./@grapecity-software/spread-common/styles/gc.spread.sheets.excel2016colorful.css" />
</head>
<body>
 <div id="testDiv" style="width:100%;height:300px;"></div>
 <script type='text/javascript' src="./@grapecity-software/spread-common/dist/gc.spread.common.min.js"></script>
 <script type='text/javascript' src="./@grapecity-software/spread-sheets-core/dist/gc.spread.sheets.core.min.js"></script>
 <script type='text/javascript'>
 window.onload = function () {
 var spread = new GC.Spread.Sheets.Workbook(document.getElementById("testDiv"));
 };
 </script>
</body>
</html>

使用 AMD 的核心模块

以下代码示例展示了如何使用 AMD 和核心模块:

<!DOCTYPE html>
<html>
<head>
    <title>Test SJS Modules with AMD</title>
    <link rel="stylesheet" type="text/css"
        href="./@grapecity-software/spread-common/styles/gc.spread.sheets.excel2016colorful.css" />
</head>
<body>
    <div id="testDiv" style="width:100%;height:300px;"></div>
    <script type='text/javascript' src="./require.js"></script>
    <script type='text/javascript'>
        window.onload = function () {
            require.config({
                paths: {
                    '@grapecity-software/spread-common': './@grapecity-software/spread-common/dist/gc.spread.common.min',
                    '@grapecity-software/spread-sheets-core': './@grapecity-software/spread-sheets-core/dist/gc.spread.sheets.core.min'
                }
            });
            require(['@grapecity-software/spread-common', '@grapecity-software/spread-sheets-core'], function (GC) {
                var spread = new GC.Spread.Sheets.Workbook(document.getElementById("testDiv"));
            });
        };
    </script>
</body>
</html>

使用 CommonJS 的核心模块

以下代码示例展示了如何使用 CommonJS 和核心模块:

import * as GC from "@grapecity-software/spread-common";
import "@grapecity-software/spread-sheets-core";
var spread = new GC.Spread.Sheets.Workbook(document.getElementById("testDiv"));

使用 CommonJS 的 sparklines 模块

以下代码示例展示了如何使用 CommonJS 和 sparklines 模块:

import * as GC from "@grapecity-software/spread-common";
import "@grapecity-software/spread-calc-engine";
import "@grapecity-software/spread-sheets-core";
import "@grapecity-software/spread-sheets-calc-engine";
import "@grapecity-software/spread-sheets-sparklines";
var spread = new GC.Spread.Sheets.Workbook(document.getElementById("testDiv"));
var sheet = spread.getActiveSheet();
sheet.suspendPaint();
sheet.setFormula(0, 0, '=PIESPARKLINE(0.25, "red"');
sheet.setRowHeight(0, 60);
sheet.resumePaint();

使用 CommonJS 的 print 模块

以下代码示例展示了如何使用 CommonJS 和 print 模块:

import * as GC from "@grapecity-software/spread-common";
import "@grapecity-software/spread-calc-engine";
import "@grapecity-software/spread-sheets-core";
import "@grapecity-software/spread-sheets-calc-engine";
import "@grapecity-software/spread-sheets-print";
var spread = new GC.Spread.Sheets.Workbook(document.getElementById("testDiv"));
var sheet = spread.getActiveSheet();
sheet.setValue(0, 0, "Hello SpreadJS!")
spread.print();

使用 CommonJS 的 中文资源模块

以下代码示例展示了如何使用 CommonJS 和 中文资源模块:

import * as GC from "@grapecity-software/spread-common";
import "@grapecity-software/spread-sheets-core";
import "@grapecity-software/spread-sheets-resources-zh";
var spread = new GC.Spread.Sheets.Workbook(document.getElementById("testDiv"));