找回密码
 立即注册

QQ登录

只需一步,快速开始

前端工程师
注册会员   /  发表于:2018-12-11 11:53  /   查看:3164  /  回复:9
用的spreadJS12版  React中使用
微信图片_20181211114807.png
微信图片_20181211114714.png

9 个回复

倒序浏览
KevinChen讲师达人认证 悬赏达人认证 SpreadJS 开发认证
论坛元老   /  发表于:2018-12-11 12:09:41
沙发
您要,您代码中引用了excelio组件,需要将license key注册到excelio上,

代码如下:

  1. GC.Spread.Sheets.LicenseKey = Excel.LicenseKey = "yourkey";
复制代码
回复 使用道具 举报
前端工程师
注册会员   /  发表于:2018-12-11 12:11:05
板凳
KevinChen 发表于 2018-12-11 12:09
您要,您代码中引用了excelio组件,需要将license key注册到excelio上,

代码如下:

Excel 是 什么呢?
回复 使用道具 举报
KevinChen讲师达人认证 悬赏达人认证 SpreadJS 开发认证
论坛元老   /  发表于:2018-12-11 12:12:57
地板

就是负责导入导出Excel的组件,excelio

您代码中包含有new GCExcelio.IO()
这个组件需要单独注册key
回复 使用道具 举报
前端工程师
注册会员   /  发表于:2018-12-11 12:25:26
5#
import React from 'react'
import PropTypes from 'prop-types';
import { connect } from 'apollo'
import '@grapecity/spread-sheets/styles/gc.spread.sheets.excel2016colorful.css';
import { Layout, Modal, Menu, Icon, Button, Form, Input, Radio, Row, Col, Upload } from 'antd';
import { SpreadSheets, Worksheet, Column } from '@grapecity/spread-sheets-react';
import GC from '@grapecity/spread-sheets'
import GCExcelio from '@grapecity/spread-excelio'
import '@grapecity/spread-sheets-resources-zh'
import '@grapecity/spread-sheets-print'
import '@grapecity/spread-sheets-pdf'
import { saveAs } from 'file-saver'
import { config } from 'utils'
import * as d3 from 'd3'
import styles from './spreadView.less'

GC.Spread.Common.CultureManager.culture('zh-cn');
GC.Spread.Sheets.LicenseKey = GCExcelio.LicenseKey = '........';


这么写了还是不行,跟刚才的错一样
回复 使用道具 举报
前端工程师
注册会员   /  发表于:2018-12-11 12:25:51
6#
跟我用的版本有关系么?12版的
回复 使用道具 举报
前端工程师
注册会员   /  发表于:2018-12-11 12:50:00
7#
KevinChen 发表于 2018-12-11 12:12
就是负责导入导出Excel的组件,excelio

您代码中包含有new GCExcelio.IO()


import React from 'react'
import PropTypes from 'prop-types';
import { connect } from 'apollo'
import '@grapecity/spread-sheets/styles/gc.spread.sheets.excel2016colorful.css';
import { Layout, Modal, Menu, Icon, Button, Form, Input, Radio, Row, Col, Upload } from 'antd';
import { SpreadSheets, Worksheet, Column } from '@grapecity/spread-sheets-react';
import GC from '@grapecity/spread-sheets'
import GCExcelio from '@grapecity/spread-excelio'
import '@grapecity/spread-sheets-resources-zh'
import '@grapecity/spread-sheets-print'
import '@grapecity/spread-sheets-pdf'
import { saveAs } from 'file-saver'
import { config } from 'utils'
import * as d3 from 'd3'
import styles from './spreadView.less'

GC.Spread.Common.CultureManager.culture('zh-cn');
GC.Spread.Sheets.LicenseKey = GCExcelio.LicenseKey = '........';


这么写了还是不行,跟刚才的错一样
回复 使用道具 举报
KevinChen讲师达人认证 悬赏达人认证 SpreadJS 开发认证
论坛元老   /  发表于:2018-12-11 14:37:54
8#
您好,您的LicenseKey是针对V12版本的吗?

使用npm下载的SpreadJS都是最新发布版本的。

大版本目前已经更新到V12,LicenseKey如果还是v11的key是无法使用的。
回复 使用道具 举报
前端工程师
注册会员   /  发表于:2018-12-11 14:55:05
9#
KevinChen 发表于 2018-12-11 14:37
您好,您的LicenseKey是针对V12版本的吗?

使用npm下载的SpreadJS都是最新发布版本的。

明白了,我的license应该是11版的,我刚刚把组件降到11版就可以了
回复 使用道具 举报
KevinChen讲师达人认证 悬赏达人认证 SpreadJS 开发认证
论坛元老   /  发表于:2018-12-11 16:16:07
10#
前端工程师 发表于 2018-12-11 14:55
明白了,我的license应该是11版的,我刚刚把组件降到11版就可以了

好的,您可以考虑升级到最新版本,如果您在金牌服务期间,可以免费升级V12的LicenseKey。
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部