mirror of
https://github.com/501351981/vue-office.git
synced 2025-06-15 07:00:00 +08:00
fix: excel不显示数字0
This commit is contained in:
parent
f6d205a9d4
commit
0e59e49167
File diff suppressed because one or more lines are too long
2
examples/dist/index.html
vendored
2
examples/dist/index.html
vendored
@ -5,7 +5,7 @@
|
||||
<link rel="icon" type="image/svg+xml" href="/vue-office/examples/dist/vite.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Vite + Vue</title>
|
||||
<script type="module" crossorigin src="/vue-office/examples/dist/assets/index-e6b861ed.js"></script>
|
||||
<script type="module" crossorigin src="/vue-office/examples/dist/assets/index-74060e95.js"></script>
|
||||
<link rel="stylesheet" href="/vue-office/examples/dist/assets/index-171e346f.css">
|
||||
</head>
|
||||
<body>
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue-office/excel",
|
||||
"version": "0.2.4",
|
||||
"version": "0.2.5",
|
||||
"description": "",
|
||||
"main": "lib/index.js",
|
||||
"files": [
|
||||
|
@ -56,6 +56,9 @@ function transferColumns(excelSheet, spreadSheet, options){
|
||||
}
|
||||
|
||||
function getCellText(cell){
|
||||
if(typeof cell.value === 'number'){
|
||||
return cell.value + ''
|
||||
}
|
||||
let cellText = ''
|
||||
if(cell.value && cell.value.result) {
|
||||
// Excel 单元格有公式
|
||||
@ -66,8 +69,7 @@ function getCellText(cell){
|
||||
// 多行文本做累加
|
||||
cellText += cell.value.richText[text].text
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// Excel 单元格无公式
|
||||
cellText = cell.value
|
||||
}
|
||||
@ -182,9 +184,9 @@ function getStyle(cell){
|
||||
|
||||
export function transferExcelToSpreadSheet(workbook, options){
|
||||
let workbookData = []
|
||||
console.log(workbook, 'workbook')
|
||||
//console.log(workbook, 'workbook')
|
||||
workbook.eachSheet((sheet) => {
|
||||
console.log(sheet,'sheet')
|
||||
//console.log(sheet,'sheet')
|
||||
// 构造x-data-spreadsheet 的 sheet 数据源结构
|
||||
let sheetData = { name: sheet.name,styles : [], rows: {},cols:{}, merges:[],media:[] }
|
||||
// 收集合并单元格信息
|
||||
|
Loading…
x
Reference in New Issue
Block a user