最近在做项目,需要从页面的表格中导出excel,一般导出excel有两种方法:一、习惯上是建模版从后台服务程序中导出;二、根据页面table中导出;综合考虑其中利弊选择二、根据页面table中导出excel,前段有用table的也有用vue的,结佣file-saver和xlsx插件进行导出excel。

没有做封装,直接改的源码

  1. /* generate workbook object from table */
  2. var defaultCellStyle = { font: { name: 'Times New Roman', sz: 16, color: { rgb: "#FF000000" }, bold: false, italic: false, underline: false }, alignment: { vertical: "center", horizontal: "center", indent: 0, wrapText: true }, border: { top: { style: "thin", color: { "auto": 1 } }, right: { style: "thin", color: { "auto": 1 } }, bottom: { style: "thin", color: { "auto": 1 } }, left: { style: "thin", color: { "auto": 1 } } } };
  3. var cell = {defaultCellStyle: defaultCellStyle};
  4. var wb = XLSX.utils.table_to_book(document.querySelector('.el-table__fixed'),cell)
  5. /* get binary string as output */
  6.  
  7. //设置表格的样式
  8. var wbout = XLSX.write(wb, { bookType: 'xlsx', bookSST: false, type: 'binary',cellStyles: true, defaultCellStyle: defaultCellStyle, showGridLines: true });
  9. var s2ab=function(s) {
  10. let buf = new ArrayBuffer(s.length);
  11. let view = new Uint8Array(buf);
  12. for (let i = 0; i !== s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF;
  13. return buf;
  14. };
  15. saveAs(new Blob([s2ab(wbout)], { type: 'application/octet-stream' }), '报表.xlsx')

页面中需要引入文件

  1. <script type="text/javascript" src="shim.min.js"></script>
  2. <script type="text/javascript" src="jszip.js"></script>
  3. <script type="text/javascript" src="xlsx.full.js"></script>
  4. <script type="text/javascript" src="Blob.js"></script>
  5. <script type="text/javascript" src="FileSaver.js"></script>

此处的xlsx.full.js是由https://github.com/SheetJS/js-xlsx下载的源文件修改的

修改主要参考了https://github.com/xSirrioNx资源

  1. var StyleBuilder = function (options) {
  2.  
  3. var customNumFmtId = 164;
  4.  
  5. var table_fmt = {
  6. 0: 'General',
  7. 1: '0',
  8. 2: '0.00',
  9. 3: '#,##0',
  10. 4: '#,##0.00',
  11. 9: '0%',
  12. 10: '0.00%',
  13. 11: '0.00E+00',
  14. 12: '# ?/?',
  15. 13: '# ??/??',
  16. 14: 'm/d/yy',
  17. 15: 'd-mmm-yy',
  18. 16: 'd-mmm',
  19. 17: 'mmm-yy',
  20. 18: 'h:mm AM/PM',
  21. 19: 'h:mm:ss AM/PM',
  22. 20: 'h:mm',
  23. 21: 'h:mm:ss',
  24. 22: 'm/d/yy h:mm',
  25. 37: '#,##0 ;(#,##0)',
  26. 38: '#,##0 ;[Red](#,##0)',
  27. 39: '#,##0.00;(#,##0.00)',
  28. 40: '#,##0.00;[Red](#,##0.00)',
  29. 45: 'mm:ss',
  30. 46: '[h]:mm:ss',
  31. 47: 'mmss.0',
  32. 48: '##0.0E+0',
  33. 49: '@',
  34. 56: '"上午/下午 "hh"時"mm"分"ss"秒 "'
  35. };
  36. var fmt_table = {};
  37.  
  38. for (var idx in table_fmt) {
  39. fmt_table[table_fmt[idx]] = idx;
  40. }
  41.  
  42. // cache style specs to avoid excessive duplication
  43. _hashIndex = {};
  44. _listIndex = [];
  45.  
  46. return {
  47.  
  48. initialize: function (options) {
  49.  
  50. this.$fonts = XmlNode('fonts').attr('count', 0).attr("x14ac:knownFonts", "1");
  51. this.$fills = XmlNode('fills').attr('count', 0);
  52. this.$borders = XmlNode('borders').attr('count', 0);
  53. this.$numFmts = XmlNode('numFmts').attr('count', 0);
  54. this.$cellStyleXfs = XmlNode('cellStyleXfs');
  55. this.$xf = XmlNode('xf')
  56. .attr('numFmtId', 0)
  57. .attr('fontId', 0)
  58. .attr('fillId', 0)
  59. .attr('borderId', 0);
  60.  
  61. this.$cellXfs = XmlNode('cellXfs').attr('count', 0);
  62. this.$cellStyles = XmlNode('cellStyles')
  63. .append(XmlNode('cellStyle')
  64. .attr('name', 'Normal')
  65. .attr('xfId', 0)
  66. .attr('builtinId', 0)
  67. );
  68. this.$dxfs = XmlNode('dxfs').attr('count', "0");
  69. this.$tableStyles = XmlNode('tableStyles')
  70. .attr('count', '0')
  71. .attr('defaultTableStyle', 'TableStyleMedium9')
  72. .attr('defaultPivotStyle', 'PivotStyleMedium4')
  73.  
  74. this.$styles = XmlNode('styleSheet')
  75. .attr('xmlns:mc', 'http://schemas.openxmlformats.org/markup-compatibility/2006')
  76. .attr('xmlns:x14ac', 'http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac')
  77. .attr('xmlns', 'http://schemas.openxmlformats.org/spreadsheetml/2006/main')
  78. .attr('mc:Ignorable', 'x14ac')
  79. .prefix('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>')
  80. .append(this.$numFmts)
  81. .append(this.$fonts)
  82. .append(this.$fills)
  83. .append(this.$borders)
  84. .append(this.$cellStyleXfs.append(this.$xf))
  85. .append(this.$cellXfs)
  86. .append(this.$cellStyles)
  87. .append(this.$dxfs)
  88. .append(this.$tableStyles);
  89.  
  90. // need to specify styles at index 0 and 1.
  91. // the second style MUST be gray125 for some reason
  92.  
  93. var defaultStyle = options.defaultCellStyle || {};
  94. if (!defaultStyle.font) defaultStyle.font = { name: 'Calibri', sz: '12' };
  95. if (!defaultStyle.font.name) defaultStyle.font.name = 'Calibri';
  96. if (!defaultStyle.font.sz) defaultStyle.font.sz = 11;
  97. if (!defaultStyle.fill) defaultStyle.fill = { patternType: "none", fgColor: {} };
  98. if (!defaultStyle.border) defaultStyle.border = {};
  99. if (!defaultStyle.numFmt) defaultStyle.numFmt = 0;
  100.  
  101. this.defaultStyle = defaultStyle;
  102.  
  103. var gray125Style = JSON.parse(JSON.stringify(defaultStyle));
  104. gray125Style.fill = { patternType: "gray125", fgColor: {} }
  105.  
  106. this.addStyles([defaultStyle, gray125Style]);
  107. return this;
  108. },
  109.  
  110. // create a style entry and returns an integer index that can be used in the cell .s property
  111. // these format of this object follows the emerging Common Spreadsheet Format
  112. addStyle: function (attributes) {
  113.  
  114. var hashKey = JSON.stringify(attributes);
  115. var index = _hashIndex[hashKey];
  116. if (index == undefined) {
  117.  
  118. index = this._addXf(attributes); //_listIndex.push(attributes) -1;
  119. _hashIndex[hashKey] = index;
  120. }
  121. else {
  122. index = _hashIndex[hashKey];
  123. }
  124. return index;
  125. },
  126.  
  127. // create style entries and returns array of integer indexes that can be used in cell .s property
  128. addStyles: function (styles) {
  129. var self = this;
  130. return styles.map(function (style) {
  131. return self.addStyle(style);
  132. })
  133. },
  134.  
  135. _duckTypeStyle: function (attributes) {
  136.  
  137. if (typeof attributes == 'object' && (attributes.patternFill || attributes.fgColor)) {
  138. return { fill: attributes }; // this must be read via XLSX.parseFile(...)
  139. }
  140. else if (attributes.font || attributes.numFmt || attributes.border || attributes.fill) {
  141. return attributes;
  142. }
  143. else {
  144. return this._getStyleCSS(attributes)
  145. }
  146. },
  147.  
  148. _getStyleCSS: function (css) {
  149. return css; //TODO
  150. },
  151.  
  152. // Create an <xf> record for the style as well as corresponding <font>, <fill>, <border>, <numfmts>
  153. // Right now this is simple and creates a <font>, <fill>, <border>, <numfmts> for every <xf>
  154. // We could perhaps get fancier and avoid duplicating auxiliary entries as Excel presumably intended, but bother.
  155. _addXf: function (attributes) {
  156.  
  157. var fontId = this._addFont(attributes.font);
  158. var fillId = this._addFill(attributes.fill);
  159. var borderId = this._addBorder(attributes.border);
  160. var numFmtId = this._addNumFmt(attributes.numFmt);
  161.  
  162. var $xf = XmlNode('xf')
  163. .attr("numFmtId", numFmtId)
  164. .attr("fontId", fontId)
  165. .attr("fillId", fillId)
  166. .attr("borderId", borderId)
  167. .attr("xfId", "0");
  168.  
  169. if (fontId > 0) {
  170. $xf.attr('applyFont', "1");
  171. }
  172. if (fillId > 0) {
  173. $xf.attr('applyFill', "1");
  174. }
  175. if (borderId > 0) {
  176. $xf.attr('applyBorder', "1");
  177. }
  178. if (numFmtId > 0) {
  179. $xf.attr('applyNumberFormat', "1");
  180. }
  181.  
  182. if (attributes.alignment) {
  183. var $alignment = XmlNode('alignment');
  184. if (attributes.alignment.horizontal) {
  185. $alignment.attr('horizontal', attributes.alignment.horizontal);
  186. }
  187. if (attributes.alignment.vertical) {
  188. $alignment.attr('vertical', attributes.alignment.vertical);
  189. }
  190. if (attributes.alignment.indent) {
  191. $alignment.attr('indent', attributes.alignment.indent);
  192. }
  193. if (attributes.alignment.readingOrder) {
  194. $alignment.attr('readingOrder', attributes.alignment.readingOrder);
  195. }
  196. if (attributes.alignment.wrapText) {
  197. $alignment.attr('wrapText', attributes.alignment.wrapText);
  198. }
  199. if (attributes.alignment.textRotation != undefined) {
  200. $alignment.attr('textRotation', attributes.alignment.textRotation);
  201. }
  202.  
  203. $xf.append($alignment).attr('applyAlignment', 1)
  204.  
  205. }
  206. this.$cellXfs.append($xf);
  207. var count = +this.$cellXfs.children().length;
  208.  
  209. this.$cellXfs.attr('count', count);
  210. return count - 1;
  211. },
  212.  
  213. _addFont: function (attributes) {
  214.  
  215. if (!attributes) {
  216. return 0;
  217. }
  218.  
  219. var $font = XmlNode('font')
  220. .append(XmlNode('sz').attr('val', attributes.sz || this.defaultStyle.font.sz))
  221. .append(XmlNode('name').attr('val', attributes.name || this.defaultStyle.font.name))
  222.  
  223. if (attributes.bold) $font.append(XmlNode('b'));
  224. if (attributes.underline) $font.append(XmlNode('u'));
  225. if (attributes.italic) $font.append(XmlNode('i'));
  226. if (attributes.strike) $font.append(XmlNode('strike'));
  227. if (attributes.outline) $font.append(XmlNode('outline'));
  228. if (attributes.shadow) $font.append(XmlNode('shadow'));
  229.  
  230. if (attributes.vertAlign) {
  231. $font.append(XmlNode('vertAlign').attr('val', attributes.vertAlign))
  232. }
  233.  
  234. if (attributes.color) {
  235. if (attributes.color.theme) {
  236. $font.append(XmlNode('color').attr('theme', attributes.color.theme))
  237.  
  238. if (attributes.color.tint) { //tint only if theme
  239. $font.append(XmlNode('tint').attr('theme', attributes.color.tint))
  240. }
  241.  
  242. } else if (attributes.color.rgb) { // not both rgb and theme
  243. $font.append(XmlNode('color').attr('rgb', attributes.color.rgb))
  244. }
  245. }
  246.  
  247. this.$fonts.append($font);
  248.  
  249. var count = this.$fonts.children().length;
  250. this.$fonts.attr('count', count);
  251. return count - 1;
  252. },
  253.  
  254. _addNumFmt: function (numFmt) {
  255. if (!numFmt) {
  256. return 0;
  257. }
  258.  
  259. if (typeof numFmt == 'string') {
  260. var numFmtIdx = fmt_table[numFmt];
  261. if (numFmtIdx >= 0) {
  262. return numFmtIdx; // we found a match against built in formats
  263. }
  264. }
  265.  
  266. if (/^[0-9]+$/.exec(numFmt)) {
  267. return numFmt; // we're matching an integer against some known code
  268. }
  269. numFmt = numFmt
  270. .replace(/&/g, '&amp;')
  271. .replace(/</g, '&lt;')
  272. .replace(/>/g, '&gt;')
  273. .replace(/"/g, '&quot;')
  274. .replace(/'/g, '&apos;');
  275.  
  276. var $numFmt = XmlNode('numFmt')
  277. .attr('numFmtId', (++customNumFmtId))
  278. .attr('formatCode', numFmt);
  279.  
  280. this.$numFmts.append($numFmt);
  281.  
  282. var count = this.$numFmts.children().length;
  283. this.$numFmts.attr('count', count);
  284. return customNumFmtId;
  285. },
  286.  
  287. _addFill: function (attributes) {
  288.  
  289. if (!attributes) {
  290. return 0;
  291. }
  292.  
  293. var $patternFill = XmlNode('patternFill')
  294. .attr('patternType', attributes.patternType || 'solid');
  295.  
  296. if (attributes.fgColor) {
  297. var $fgColor = XmlNode('fgColor');
  298.  
  299. //Excel doesn't like it when we set both rgb and theme+tint, but xlsx.parseFile() sets both
  300. //var $fgColor = createElement('<fgColor/>', null, null, {xmlMode: true}).attr(attributes.fgColor)
  301. if (attributes.fgColor.rgb) {
  302.  
  303. if (attributes.fgColor.rgb.length == 6) {
  304. attributes.fgColor.rgb = "FF" + attributes.fgColor.rgb /// add alpha to an RGB as Excel expects aRGB
  305. }
  306.  
  307. $fgColor.attr('rgb', attributes.fgColor.rgb);
  308. $patternFill.append($fgColor);
  309. }
  310. else if (attributes.fgColor.theme) {
  311. $fgColor.attr('theme', attributes.fgColor.theme);
  312. if (attributes.fgColor.tint) {
  313. $fgColor.attr('tint', attributes.fgColor.tint);
  314. }
  315. $patternFill.append($fgColor);
  316. }
  317.  
  318. if (!attributes.bgColor) {
  319. attributes.bgColor = { "indexed": "64" }
  320. }
  321. }
  322.  
  323. if (attributes.bgColor) {
  324. var $bgColor = XmlNode('bgColor').attr(attributes.bgColor);
  325. $patternFill.append($bgColor);
  326. }
  327.  
  328. var $fill = XmlNode('fill')
  329. .append($patternFill);
  330.  
  331. this.$fills.append($fill);
  332.  
  333. var count = this.$fills.children().length;
  334. this.$fills.attr('count', count);
  335. return count - 1;
  336. },
  337.  
  338. _getSubBorder: function (direction, spec) {
  339.  
  340. var $direction = XmlNode(direction);
  341. if (spec) {
  342. if (spec.style) $direction.attr('style', spec.style);
  343. if (spec.color) {
  344. var $color = XmlNode('color');
  345. if (spec.color.auto) {
  346. $color.attr('auto', spec.color.auto);
  347. }
  348. else if (spec.color.rgb) {
  349. $color.attr('rgb', spec.color.rgb);
  350. }
  351. else if (spec.color.theme || spec.color.tint) {
  352. $color.attr('theme', spec.color.theme || "1");
  353. $color.attr('tint', spec.color.tint || "0");
  354. }
  355. $direction.append($color)
  356. }
  357. }
  358. return $direction;
  359. },
  360.  
  361. _addBorder: function (attributes) {
  362. if (!attributes) {
  363. return 0;
  364. }
  365.  
  366. var self = this;
  367.  
  368. var $border = XmlNode('border')
  369. .attr("diagonalUp", attributes.diagonalUp)
  370. .attr("diagonalDown", attributes.diagonalDown);
  371.  
  372. var directions = ["left", "right", "top", "bottom", "diagonal"];
  373.  
  374. directions.forEach(function (direction) {
  375. $border.append(self._getSubBorder(direction, attributes[direction]))
  376. });
  377. this.$borders.append($border);
  378.  
  379. var count = this.$borders.children().length;
  380. this.$borders.attr('count', count);
  381. return count - 1;
  382. },
  383.  
  384. toXml: function () {
  385. return this.$styles.toXml();
  386. }
  387. }.initialize(options || {});
  388. }
  1. function get_cell_style(styles, cell, opts) {
  2. if (typeof style_builder != 'undefined') {
  3. if (/^\d+$/.exec(cell.s)) {
  4. return cell.s
  5. } // if its already an integer index, let it be
  6. if (cell.s && (cell.s == +cell.s)) {
  7. return cell.s
  8. } // if its already an integer index, let it be
  9. var s = cell.s || {};
  10. if (cell.z) s.numFmt = cell.z;
  11. return style_builder.addStyle(s);
  12. }
  13. else {
  14. var z = opts.revssf[cell.z != null ? cell.z : "General"];
  15. var i = 0x3c, len = styles.length;
  16. if (z == null && opts.ssf) {
  17. for (; i < 0x188; ++i) if (opts.ssf[i] == null) {
  18. SSF.load(cell.z, i);
  19. opts.ssf[i] = cell.z;
  20. opts.revssf[cell.z] = z = i;
  21. break;
  22. }
  23. }
  24. for (i = 0; i != len; ++i) if (styles[i].numFmtId === z) return i;
  25. styles[len] = {
  26. numFmtId: z,
  27. fontId: 0,
  28. fillId: 0,
  29. borderId: 0,
  30. xfId: 0,
  31. applyNumberFormat: 1
  32. };
  33. return len;
  34. }
  35. }

和我自己的以下的修改

  1. function parse_dom_table(table, _opts) {
  2. var opts = _opts || {};
  3. var oss = opts.defaultCellStyle||{}; /*单元格样式 */
  4. if (DENSE != null) opts.dense = DENSE;
  5. var ws = opts.dense ? ([]) : ({});
  6. var rows = table.getElementsByTagName('tr');
  7. var sheetRows = Math.min(opts.sheetRows || 10000000, rows.length);
  8. var range = { s: { r: 0, c: 0 }, e: { r: sheetRows - 1, c: 0 } };
  9. var merges = [], midx = 0;
  10. var R = 0, _C = 0, C = 0, RS = 0, CS = 0;
  11. for (; R < sheetRows; ++R) {
  12. var row = rows[R];
  13. var elts = (row.children);
  14. for (_C = C = 0; _C < elts.length; ++_C) {
  15. var elt = elts[_C], v = htmldecode(elts[_C].innerHTML);
  16. for (midx = 0; midx < merges.length; ++midx) {
  17. var m = merges[midx];
  18. if (m.s.c == C && m.s.r <= R && R <= m.e.r)
  19. {
  20. C = m.e.c + 1; midx = -1;
  21. }
  22. }
  23. /* TODO: figure out how to extract nonstandard mso- style */
  24. CS = +elt.getAttribute("colspan") || 1;
  25. if ((RS = +elt.getAttribute("rowspan")) > 0 || CS > 1)
  26. merges.push({ s: { r: R, c: C }, e: { r: R + (RS || 1) - 1, c: C + CS - 1 } });
  27. var o = { t: 's', v: v,s:oss};
  28. var _t = elt.getAttribute("t") || "";
  29. if (v != null) {
  30. if (v.length == 0) o.t = _t || 's';
  31. else if (opts.raw || v.trim().length == 0 || _t == "s") { }
  32. else if (v === 'TRUE') o = { t: 'b', v: true, s: oss };
  33. else if (v === 'FALSE') o = { t: 'b', v: false, s: oss };
  34. else if (!isNaN(fuzzynum(v))) o = { t: 'n', v: fuzzynum(v), s: oss };
  35. else if (!isNaN(fuzzydate(v).getDate())) {
  36. o = ({ t: 'd', v: parseDate(v), s: oss });
  37. if (!opts.cellDates) o = ({ t: 'n', v: datenum(o.v), s: oss });
  38. o.z = opts.dateNF || SSF._table[14];
  39. }
  40. }
  41. if (opts.dense) { if (!ws[R]) ws[R] = []; ws[R][C] = o; }
  42. else ws[encode_cell({ c: C, r: R })] = o;
  43. /* 合并数据处理开始*/
  44. if (CS > 1) {
  45. for (var i = 1; i < CS; i++) {
  46. var newc = C + i
  47. if (RS > 1) {
  48. for (var m = 1; m < RS; m++) {
  49. var newr = R + m;
  50. ws[encode_cell({ c: newc, r: newr })] = o;
  51. }
  52. }
  53. else {
  54. ws[encode_cell({ c: newc, r: R })] = o;
  55. }
  56. }
  57. }
  58. else {
  59. if (RS > 1) {
  60. for (var m = 1; m < RS; m++) {
  61. var newr = R + m;
  62. ws[encode_cell({ c: C, r: newr })] = o;
  63. }
  64. }
  65. else {
  66. ws[encode_cell({ c: C, r: R })] = o;
  67. }
  68. }
  69. /*合并数据处理结束*/
  70. if (range.e.c < C) range.e.c = C;
  71. C += CS;
  72.  
  73. }
  74. }
  75. ws['!merges'] = merges;
  76. ws['!ref'] = encode_range(range);
  77. if (sheetRows < rows.length) ws['!fullref'] = encode_range((range.e.r = rows.length - 1, range));
  78. return ws;
  79. }

参考:

https://github.com/SheetJS/js-xlsx
https://github.com/xSirrioNx/js-xlsx
https://www.jianshu.com/p/063badece350
http://www.cnblogs.com/jtjds/p/8892510.html

【js-xlsx和file-saver插件】前端html的table导出数据到excel的表格合并显示boder的更多相关文章

  1. java代码导出数据到Excel、js导出数据到Excel(三)

     jsp内容忽略,仅写个出发按钮:          <button style="width: 100px" onclick="expertExcel()&quo ...

  2. js操作table表格导出数据到excel方法

    js导出excel资料很少,网上也找了很多,基本都不能用,要么只能是IE用,还必须要权限,这是非常不好的.后来到github上找到table2excel.js,虽然可以用,但仍然对IE支持不够,也算不 ...

  3. js实现导出数据到excel

    来自:http://www.imooc.com/article/13374 //html代码<!DOCTYPE HTML> <html> <head> <ti ...

  4. 【js-xlsx和file-saver插件】前端导出数据到excel

    最近在做项目,前端进行处理数据,导出excel中,还是遇到不少问题,这里将其进行总结一下,博主是vue框架开发,借用file-saver和xlsx插件进行导出excel,我们来看下代码和效果.地址链接 ...

  5. springboot2.1.8使用poi导出数据生成excel(.xlsx)文件

    前言:在实际开发中经常需要将数据库的数据导出成excel文件,poi方式则是其中一种较为常用的导出框架.简单读取excel文件在之前的一篇有说明 本项目实现需求:user发出一个导出student信息 ...

  6. PHPExcel 导出数据(xls或xlsx)- 助手类(函数)

    本文链接:https://www.cnblogs.com/tujia/p/11358096.html 说明:简单好用的导出助手,轻松导出数据到 excel !! 使用示例: Example: Exce ...

  7. Resumable.js – 基于 HTML5 File API 的文件上传

    Resumable.js 是一个 JavaScript 库,通过 HTML5 文件 API 提供,稳定和可恢复的批量上传功能.在上传大文件的时候通过每个文件分割成小块,每块在上传失败的时候,上传会不断 ...

  8. html table表格导出excel的方法 html5 table导出Excel HTML用JS导出Excel的五种方法 html中table导出Excel 前端开发 将table内容导出到excel HTML table导出到Excel中的解决办法 js实现table导出Excel,保留table样式

    先上代码   <script type="text/javascript" language="javascript">   var idTmr; ...

  9. 从 0 到 1 到完美,写一个 js 库、node 库、前端组件库

    之前讲了很多关于项目工程化.前端架构.前端构建等方面的技术,这次说说怎么写一个完美的第三方库. 1. 选择合适的规范来写代码 js 模块化的发展大致有这样一个过程 iife => commonj ...

随机推荐

  1. React Native项目组织结构介绍

    代码组织: 目录结构: . ├── components //组成应用的各个组件 │   ├── Routers.android.js //每个组件若实现不一样,分为android的实现和ios的实现 ...

  2. 调试bootmgr&winload vista&win7 x86&x64

    设置调试bootmgr 1.以管理员权限运行cmd.exe 2.执行以下命令 3.  参照我的另一篇文章<win8 + vmware + windbg 双机调试 >中的第1.3步,建立wi ...

  3. 尚学堂马士兵struts2 课堂笔记(二)

    14通配符问题 其实这个问题看一个例子就ok <package name="actions" extends="struts-default" names ...

  4. 【翻译】如何在Ext JS 6中使用Fashion美化应用程序

    原文:How to Style Apps with Fashion in Ext JS 6 在Ext JS 6,一个最大的改变就是框架合并,使用一个单一的代码库,就可以为每一种设备开发各具有良好体验的 ...

  5. Demand Side Platform

    DSP特点: DSP不是从网络媒体那里包买广告位,也不是采用CPD(Cost Per Day)的方式获得广告位:而是从广告交易平台(AdExchange)来通过实时竞价的方式获得对广告进行曝光的机会, ...

  6. javascript之JSON引入

    JSON: JavaScript Object Notation   JavaScript 对象表示法. 由于现在很多在服务器获取数据,很多都涉及json数据格式,因此学习json非常有必要. * 语 ...

  7. ubuntu 开发环境配置及安装 nodejs

    ubuntu 开发环境配置及安装 nodejs 1 安装nodejs $ sudo apt-get install build-essential $ sudo apt-get install gcc ...

  8. java实现http的post和get

    前话说一句:conn.setDefaultRequestProperty(key, value);这个函数是设置属性的,其实可以没有!   自己写了一个简单的get,容易控制 public stati ...

  9. 手把手带你做一个超炫酷loading成功动画view Android自定义view

    写在前面: 本篇可能是手把手自定义view系列最后一篇了,实际上我也是一周前才开始真正接触自定义view,通过这一周的练习,基本上已经熟练自定义view,能够应对一般的view需要,那么就以本篇来结尾 ...

  10. 如何反编译APK?

    1.概述 一些商业的app都包含很多精美的图片还有一些比较好的配置文件,以前某师兄就说过apk把后缀改为zip,然后解压一下就可以获得很多图片资源,但是这时候你打开一下解压出来的xml资源全是乱码.通 ...