kinddde / js-export-excel Goto Github PK
View Code? Open in Web Editor NEWjson导出excel(纯js 支持中文) ES6 module
json导出excel(纯js 支持中文) ES6 module
npm仓库里的版本1.0.3里面class语法报错,babel不会自动转码node_modules里面的js文件
导出的excel。如果填入的数字过长保存后会变成科学技术法
根据数据的不同设置背景色
如题
是否可以支持分页打印的功能?
怎么能设置全部居左
默认有点丑,希望能居中;
yarn build 的时候出现了如下错误:
Unexpected token: name (sj) [./~/js-export-excel/src/json-export-excel.js:12,0][static/js/index.e208170a.js:101337,9]
你好 请问目前仅支持写入string吗? 能写入base64位编码的图片吗? 谢谢~
麻烦请问一下,对文件大小,或者colums和rows有做限制吗
提示找不到Blob.js.
Blob.js在npm中的名字是 blob.js,package.json中写错了。
希望发布转成es5
请问可以设置某一列得单元格格式是文本么
对于有多层层级关系的表头的表格怎么导出呢
wourd be gleat ;-)
支持添加水印嘛
按着文档的样式操作,导出的excel表头和表体数据错位,不对应。难道表头和表体的对应规则,不是表头插入字段顺序
麻烦更新下吧
Error: Sheet name cannot contain : \ / ? * [ ]
这种报错有方法避免吗? 除了正则强制替换特殊字符。
因为微信客户端屏蔽了 文件下载,所以需求 在网页端生成文件流 然后 上传 到 file 服务生成 url给用户,这边 模块 能否提供获取 文件流接口,或者我需要在源码哪个位置获取呢
Requirement- It should export hyperlink as well for excel values
让excel表格前几行显示自定义的信息,具体数据在下方显示
打包会出现Unexpected token: name (sj) [8.5c86bdf0.async.js:49105,9]
webpack base配置
var path = require('path')
var utils = require('./utils')
var config = require('../config')
var vueLoaderConfig = require('./vue-loader.conf')
function resolve (dir) {
return path.join(__dirname, '..', dir)
}
module.exports = {
entry: {
app: './src/main.js'
},
output: {
path: config.build.assetsRoot,
filename: '[name].js',
publicPath: process.env.NODE_ENV === 'production'
? config.build.assetsPublicPath
: config.dev.assetsPublicPath
},
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
'vue$': 'vue/dist/vue.esm.js',
'@': resolve('src'),
}
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
options: vueLoaderConfig
},
{
test: /\.js$/,
loader: 'babel-loader',
include: [resolve('src'), resolve('test')]
},
{
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('img/[name].[hash:7].[ext]')
}
},
{
test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('media/[name].[hash:7].[ext]')
}
},
{
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
}
}
]
}
}
prod配置:
var path = require('path')
var utils = require('./utils')
var webpack = require('webpack')
var config = require('../config')
var merge = require('webpack-merge')
var baseWebpackConfig = require('./webpack.base.conf')
var CopyWebpackPlugin = require('copy-webpack-plugin')
var HtmlWebpackPlugin = require('html-webpack-plugin')
var ExtractTextPlugin = require('extract-text-webpack-plugin')
var OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
var env = config.build.env
var webpackConfig = merge(baseWebpackConfig, {
module: {
rules: utils.styleLoaders({
sourceMap: config.build.productionSourceMap,
extract: true
})
},
devtool: config.build.productionSourceMap ? '#source-map' : false,
output: {
path: config.build.assetsRoot,
filename: utils.assetsPath('js/[name].[chunkhash].js'),
chunkFilename: utils.assetsPath('js/[id].[chunkhash].js')
},
plugins: [
// http://vuejs.github.io/vue-loader/en/workflow/production.html
new webpack.DefinePlugin({
'process.env': env
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
},
sourceMap: true
}),
// extract css into its own file
new ExtractTextPlugin({
filename: utils.assetsPath('css/[name].[contenthash].css')
}),
// Compress extracted CSS. We are using this plugin so that possible
// duplicated CSS from different components can be deduped.
new OptimizeCSSPlugin({
cssProcessorOptions: {
safe: true
}
}),
// generate dist index.html with correct asset hash for caching.
// you can customize output by editing /index.html
// see https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: config.build.index,
template: 'index.html',
inject: true,
minify: {
removeComments: true,
collapseWhitespace: true,
removeAttributeQuotes: true
// more options:
// https://github.com/kangax/html-minifier#options-quick-reference
},
// necessary to consistently work with multiple chunks via CommonsChunkPlugin
chunksSortMode: 'dependency'
}),
// keep module.id stable when vender modules does not change
new webpack.HashedModuleIdsPlugin(),
// split vendor js into its own file
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks: function (module, count) {
// any required modules inside node_modules are extracted to vendor
return (
module.resource &&
/\.js$/.test(module.resource) &&
module.resource.indexOf(
path.join(__dirname, '../node_modules')
) === 0
)
}
}),
// extract webpack runtime and module manifest to its own file in order to
// prevent vendor hash from being updated whenever app bundle is updated
new webpack.optimize.CommonsChunkPlugin({
name: 'manifest',
chunks: ['vendor']
}),
// copy custom static assets
new CopyWebpackPlugin([
{
from: path.resolve(__dirname, '../static'),
to: config.build.assetsSubDirectory,
ignore: ['.*']
}
])
]
})
if (config.build.productionGzip) {
var CompressionWebpackPlugin = require('compression-webpack-plugin')
webpackConfig.plugins.push(
new CompressionWebpackPlugin({
asset: '[path].gz[query]',
algorithm: 'gzip',
test: new RegExp(
'\\.(' +
config.build.productionGzipExtensions.join('|') +
')$'
),
threshold: 10240,
minRatio: 0.8
})
)
}
if (config.build.bundleAnalyzerReport) {
var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
webpackConfig.plugins.push(new BundleAnalyzerPlugin())
}
module.exports = webpackConfig
package.json:
"dependencies": {
"axios": "^0.16.2",
"babel-helper-vue-jsx-merge-props": "^2.0.2",
"babel-plugin-syntax-jsx": "^6.18.0",
"babel-plugin-transform-vue-jsx": "^3.5.0",
"babel-preset-es2015": "^6.24.1",
"echarts": "^3.8.5",
"element-ui": "^1.4.12",
"js-export-excel": "1.0.4",
"moment": "^2.20.1",
"vue": "^2.4.2",
"vue-resource": "^1.3.4",
"vue-router": "^2.7.0",
"vuex": "^2.4.0"
},
"devDependencies": {
"autoprefixer": "^7.1.2",
"babel-core": "^6.22.1",
"babel-loader": "^7.1.4",
"babel-plugin-component": "^0.10.1",
"babel-plugin-transform-runtime": "^6.22.0",
"babel-preset-env": "^1.3.2",
"babel-preset-es2015": "^6.24.1",
"babel-preset-stage-2": "^6.22.0",
"babel-register": "^6.22.0",
"chalk": "^2.0.1",
"compression-webpack-plugin": "^1.0.0",
"connect-history-api-fallback": "^1.3.0",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^0.28.0",
"cssnano": "^3.10.0",
"eventsource-polyfill": "^0.9.6",
"express": "^4.14.1",
"extract-text-webpack-plugin": "^2.0.0",
"file-loader": "^0.11.1",
"friendly-errors-webpack-plugin": "^1.1.3",
"html-webpack-plugin": "^2.28.0",
"http-proxy-middleware": "^0.17.3",
"js-export-excel": "^1.0.4",
"opn": "^5.1.0",
"optimize-css-assets-webpack-plugin": "^2.0.0",
"ora": "^1.2.0",
"rimraf": "^2.6.0",
"semver": "^5.3.0",
"shelljs": "^0.7.6",
"url-loader": "^0.5.8",
"vue-loader": "^13.0.4",
"vue-style-loader": "^3.0.1",
"vue-template-compiler": "^2.4.2",
"webpack": "^2.6.1",
"webpack-bundle-analyzer": "^2.2.1",
"webpack-dev-middleware": "^1.10.0",
"webpack-hot-middleware": "^2.18.0",
"webpack-merge": "^4.1.0"
},
"engines": {
"node": ">= 4.0.0",
"npm": ">= 3.0.0"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]
I use react 16.4.1 ,when i was developing. It was right.When I build my project, i got the error.
$ node scripts/build.js
Creating an optimized production build...
Failed to compile.
Failed to minify the code from this file:
./node_modules/js-export-excel/src/js-export-excel.js:12
Read more here: http://bit.ly/2tRViJ9
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
License is missing for this project, can this be used for commercial projects
如题
可以增加自动换行的功能吗?非常期待!
打开example中的index.html 文件名内容。不能是进行导出演示
关联对象查询的时候怎么取值显示呢
以下是报错信息
ERROR in static/js/vendor.308876b64f9f4710da5b.js from UglifyJs
Unexpected token: name (sj) [./~/js-export-excel/src/json-export-excel.js:12,0][static/js/vendor.308876b64f9f4710da5b.js:84644,9]
How to combine cells
已经npm install成功了,在node-modules也可以看到,也创建了一个声明文件,但是页面还是打不开。报错信息:mf-va_remoteEntry.js:777 Uncaught (in promise) Error: Module "./js-export-excel" does not exist in container.
while loading "./js-export-excel" from webpack/container/reference/mf
请问支持显示图片吗
sheetData=[['一行一列','一行二列'],['二行一列','二行二列']]; //不可以
sheetData=[{one:'一行一列',two:'一行二列'},{one:'二行一列',two:'二行二列'}]; //可以
能不能支持返回Blob格式数据,不直接下载,有时候需要上传或者压缩之类的
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.