New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
中文如何设置 #281
Comments
请引用1.1.0版本 |
引用 1.1.0 也没有成功。 |
找到原因了。 <script type="text/javascript" src="locale/zh-cn.js"></script> <script type="text/javascript" src="xspreadsheet.js"></script>将位置调整一下。 |
同样的问题,最后把zh-cn.js里面语言数据直接写到项目代码上才解决
|
试过了没用,很明显是引用的 zh-cn.js 根本没执行到最后就退出了,搞不懂为什么简单的逻辑写这么复杂 |
文档提供的引用方式不对,应该是: import 'x-data-spreadsheet/dist/locale/zh-cn';
Spreadsheet.locale('zh-cn'); |
感谢@noirlyrik, 文档会更新 |
import 'x-data-spreadsheet/dist/locale/zh-cn'
Spreadsheet.locale('zh-cn', (window.x_spreadsheet as any).$messages['zh-cn']) 这样可以了 |
vue3 这样,才编过: Spreadsheet.locale('zh-cn', (window.x_spreadsheet).$messages['zh-cn']) |
vue2+npm |
vue3 + vite 这样成功了 // 引入src下的依赖
import zhCN from 'x-data-spreadsheet/src/locale/zh-cn';
import Spreadsheet from 'x-data-spreadsheet';
// 设置中文
Spreadsheet.locale('zh-cn', zhCN); |
vue2+npm直接这样就行啦 |
我搞后端的,不是很懂JS,试着用CDN,按照着写,不对啊
然后试着去改x-spreadsheet-master\dist的index.html
然后设置中文,去掉里面的这几行注释,然后又报错~
The text was updated successfully, but these errors were encountered: