{"id":101916,"date":"2020-05-23T12:42:43","date_gmt":"2020-05-23T04:42:43","guid":{"rendered":"http:\/\/4563.org\/?p=101916"},"modified":"2020-05-23T12:42:43","modified_gmt":"2020-05-23T04:42:43","slug":"%e6%9c%89%e5%93%aa%e4%ba%9b-js-%e6%8f%92%e4%bb%b6%ef%bc%8c%e8%83%bd%e6%8a%8a-js-%e5%89%8d%e7%ab%af%e7%9a%84%e6%95%b0%e6%8d%ae%e8%bd%ac%e6%88%90%e6%96%87%e4%bb%b6%e4%b8%8b%e8%bd%bd%e7%9a%84%ef%bc%9f","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=101916","title":{"rendered":"\u6709\u54ea\u4e9b js \u63d2\u4ef6\uff0c\u80fd\u628a js \u524d\u7aef\u7684\u6570\u636e\u8f6c\u6210\u6587\u4ef6\u4e0b\u8f7d\u7684\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u6709\u54ea\u4e9b js \u63d2\u4ef6\uff0c\u80fd\u628a js \u524d\u7aef\u7684\u6570\u636e\u8f6c\u6210\u6587\u4ef6\u4e0b\u8f7d\u7684\uff1f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : tctc4869 <\/span>  <span><i><\/i> 2<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u540e\u7aef\u7684\u6587\u4ef6\u4e0b\u8f7d,\u4e0d\u540c\u7684 mvc \u6846\u67b6\uff0c\u5904\u7406\u662f\u4e0d\u540c\u7684\uff0c\u6709\u4e9b\u9ebb\u70e6\uff0c\u56e0\u6b64\u6211\u5bf9\u4e8e\u6570\u636e\u4e0b\u8f7d\uff0c\u6211\u504f\u5411\u4e8e\u5148\u5f04\u5230 web \u524d\u7aef\uff0c\u7136\u540e\u7528\u8fc7 web \u524d\u7aef\u7684 \u628a js \u6570\u636e\uff0c\u4f8b\u5982 \u628a js \u7684 json \u6570\u636e \u8f6c\u6210\u6587\u4ef6\u4e0b\u8f7d\uff0c\u4f8b\u5982 excel\uff0ctxt\uff0cpdf \u3002<\/p>\n<p>\u5bf9\u4e8e\u8fd9\u65b9\u9762\uff0c\u5404\u4f4d\u77e5\u9053\u54ea\u4e9b\u5462\uff0c\u5bf9\u4e8e\u8868\u683c\u6570\u636e\u7684\u4e0b\u8f7d\uff0c\u9664\u4e86\u628a\u8868\u683c\u8f6c excel\uff0c\u8fd8\u6709\u76f4\u63a5\u5b9a\u5236 html \u5185\u5bb9\u8f6c\u6210 pdf \u4e0b\u8f7d\u7684\u4e48\uff1f<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>15<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"1692678\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lululau <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5bfc\u51fa\u6570\u636e\u5c31 csv \u5427\uff0c\u522b\u60ef\u90a3\u4e9b\u81ed\u6bdb\u75c5                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1692679\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : jydeng <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             html =&gt; canvas =&gt; pdf <br \/>html2canvas \u3001jspdf \u5751\u591a\uff0c\u8981\u8c28\u614e\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1692680\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : dixeran <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5199 @media print \u6837\u5f0f\uff0c\u7136\u540e\u8c03\u7528\u6d4f\u89c8\u5668\u7684\u6253\u5370                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1692681\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : sadfQED2 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             csv +1                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1692682\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : tctc4869 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @jydeng \u95ee\u4e00\u4e0b\uff0c\u5982\u679c\u8981\u628a html \u5f04\u7684\u597d\u770b\u70b9\uff0c\u53ef\u80fd\u5f97\u5f15\u7528\u63d2\u4ef6\uff0c\u5728\u8f6c\u6210\u5355\u4e2a pdf \u6587\u4ef6\uff0c\u8fd9\u4e2a\u5728 js \u91cc\u6709\u4ec0\u4e48\u65b9\u5f0f\u53ef\u4ee5\u5b9e\u73b0\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1692683\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : tctc4869 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @tctc4869 <br \/>@jydeng <\/p>\n<p>\u6bd4\u5982\u6211\u8981\u628a\u5f15\u7528\u4e00\u4e9b js \u548c css \u63d2\u4ef6\uff0c\u4f9d\u636e url\uff0c\u5728\u751f\u6210 html\uff0c\u586b\u5165\u5f15\u7528\uff0c\u7136\u540e\u8f6c\u6210 pdf \u6216\u5355\u4e2a\u6587\u4ef6\uff0c\u8fd9\u4e2a\u6709\u4ec0\u4e48\u597d\u7684\u65b9\u5f0f\u4e48\uff1f                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1692684\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : jydeng <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @tctc4869 \u53ef\u4ee5\uff0chtml2Canvas \u5c31\u662f\u628a\u4f60\u770b\u5230\u7684\u9875\u9762\u8f6c\u6210 canvas.                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1692685\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : SilentDepth <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6587\u672c\u7c7b\u7684\u6570\u636e\u8f6c\u6210 Blob \u7136\u540e createObjectURL \u5c31\u53ef\u4ee5\u4ea4\u7ed9 &lt;a&gt; \u4e0b\u8f7d\u4e86\u3002<\/p>\n<p>\u5176\u4ed6\u590d\u6742\u7c7b\u578b\u7684\u5148\u7528\u5de5\u5177\u5e93\u5c01\u88c5\uff08 xlsx.js \u3001pdf.js \u7b49\uff09\uff0c\u7136\u540e\u540c\u6837\u8f6c\u6210 Blob \u518d\u4e0b\u8f7d\u3002<\/p>\n<p>Canvas \u7684\u8bdd\uff0c\u53ef\u4ee5\u8003\u8651 Pico\uff0c\u8d28\u91cf\u6bd4 html2canvas \u9ad8\u5f88\u591a\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1692686\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Cbdy <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             https:\/\/github.com\/cbdyzj\/design\/blob\/master\/src\/util\/excel.ts                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1692687\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : tctc4869 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @SilentDepth \u95ee\u4e00\u4e0b\uff0c\u5047\u82e5\u6211\u6709\u4e00\u4e2a\u6bd4\u8f83\u590d\u6742 json \u6570\u636e\uff08\u6709\u952e\u503c\u5bf9\uff0c\u4e5f\u6709\u96c6\u5408\uff09\uff0c\u5728\u524d\u7aef js \u73af\u5883\u4e2d\uff0c\u6211\u8981\u628a\u8fd9\u4e2a json \u6570\u636e\u8fdb\u884c\u53ef\u81ea\u5b9a\u4e49\u7684\u53ef\u89c6\u5316\u663e\u793a\uff08\u901a\u8fc7\u6a21\u677f\u5f15\u64ce\u4ee5\u53ca\u6a21\u677f\u4ee3\u7801\uff0c\u5c06 json \u7684\u6570\u636e\u53ef\u89c6\u5316\u6210\u5e26\u6709\u6587\u5b57\u884c\u6bb5\u843d\u548c\u8868\u683c\u7684\u5185\u5bb9\uff09\uff0c\u7136\u540e\u5728\u628a\u5185\u5bb9\u663e\u793a\u7684\u6548\u679c\u8f6c\u5316\u6210\u5355\u4e2a\u6587\u4ef6\uff08 html \u6216 md \u6587\u4ef6\uff09\u4e0b\u8f7d\u5230\u672c\u5730\uff0c\u5728\u672c\u5730\u53ef\u901a\u8fc7\u6d4f\u89c8\u5668\u6216\u8005\u662f markdown \u8f6f\u4ef6\u67e5\u770b\u3002\u8fd9\u4e2a js \u80fd\u505a\u5230\u4e48\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1692688\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : SilentDepth <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @tctc4869 #10 \u5982\u679c\u662f\u8f6c\u5316\u6210\u6587\u672c\u6570\u636e\uff08 HTML \u3001MD \uff09\uff0c\u628a JSON \u770b\u505a AST\uff0c\u5176\u5b9e\u5c31\u662f\u4e2a Transform \u7684\u8fc7\u7a0b\uff0c\u62fc\u88c5\u597d\u76ee\u6807\u5b57\u7b26\u4e32\u5c31\u884c\u4e86\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1692689\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : tctc4869 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @SilentDepth <br \/>\u5982\u679c\u6709\u5f15\u7528\u7684\u56fe\u7247\u548c\u5f15\u7528\u7684 js \u548c css \u8d44\u6e90\uff0c\u8981\u600e\u4e48\u529e\uff1f\u628a\u8fd9\u4e9b\u4e0b\u8f7d\u5230\u672c\u5730\u4e5f\u662f\u53ef\u4ee5\uff0c<br \/>\u4f46\u6211\u8981\u60f3\u8981\u4e0b\u8f7d\u7684\u65f6\u5019\u90fd\u88c5\u8fdb\u4e00\u4e2a\u6587\u4ef6\u91cc\uff0c\u8fd9\u4e2a\u8981\u5728 js \u91cc\u8981\u600e\u4e48\u5f04\uff0c\u6709\u6f14\u793a\u8fde\u63a5\u4e48\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1692690\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : SilentDepth <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @tctc4869 #12 \u538b\u7f29\uff0c\u4f8b\u5982\u7528 jszip \u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1692691\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lblblong <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             file-saver \u5c31\u53ef\u4ee5 https:\/\/www.npmjs.com\/package\/file-saver<br \/>\u6216\u8005\u76f4\u63a5\u81ea\u5df1\u5199\uff1a https:\/\/www.pianduan.fun\/code\/407                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1692692\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Xezzon <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             function down(data) {<br \/> let download = document.createElement(&#8220;a&#8221;)<br \/> download.href = &#8220;data:text\/json;utf-8,&#8221; + JSON.stringify(data)<br \/> download.download = &#8220;\u6587\u4ef6\u540d.json&#8221;<br \/> download.click()<br \/>}                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u6709\u54ea\u4e9b js \u63d2\u4ef6\uff0c\u80fd\u628a js \u524d&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/101916"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=101916"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/101916\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=101916"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=101916"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=101916"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}