{"id":6565,"date":"2017-11-30T01:19:13","date_gmt":"2017-11-29T17:19:13","guid":{"rendered":"http:\/\/www.zhangxinxu.com\/wordpress\/?p=6565"},"modified":"2018-01-10T23:48:48","modified_gmt":"2018-01-10T15:48:48","slug":"raster-image-vector-svg-canvas-primitive-js","status":"publish","type":"post","link":"https:\/\/www.zhangxinxu.com\/wordpress\/2017\/11\/raster-image-vector-svg-canvas-primitive-js\/","title":{"rendered":"\u7167\u7247\u4f4d\u56fe\u8f6cSVG\u77e2\u91cf\u56fe\u7247JS\u5de5\u5177primitive.js\u7b49\u7b80\u4ecb"},"content":{"rendered":"<p>by <a href=\"http:\/\/www.zhangxinxu.com\/\">zhangxinxu<\/a> from <a href=\"http:\/\/www.zhangxinxu.com\/wordpress\/?p=6565\">http:\/\/www.zhangxinxu.com\/wordpress\/?p=6565<\/a><br \/>\n\u672c\u6587\u53ef\u5168\u6587\u8f6c\u8f7d\uff0c\u4f46\u9700\u5f97\u5230\u539f\u4f5c\u8005\u4e66\u9762\u8bb8\u53ef\uff0c\u540c\u65f6\u4fdd\u7559\u539f\u4f5c\u8005\u548c\u51fa\u5904\uff0c\u6458\u8981\u5f15\u6d41\u5219\u968f\u610f\u3002<\/p>\n<h3>\u4e00\u3001\u5173\u4e8eprimitive<\/h3>\n<p>primitive\u662f\u76f8\u5bf9\u6765\u8bf4\u6bd4\u8f83\u6709\u540d\u7684\u5c06\u7167\u7247\u56fe\u7247\u4f7f\u7528\u51e0\u4f55\u56fe\u5f62\u91cd\u5efa\u7684\u5de5\u5177\u3002\u539f\u59cb\u9879\u76ee\u4e3ago\u8bed\u8a00\uff0c\u504f\u670d\u52a1\u548c\u540e\u7aef\u4f7f\u7528\uff0c\u9879\u76ee\u5730\u5740\uff1a<a href=\"https:\/\/github.com\/fogleman\/primitive\" rel=\"nofollow\" target=\"_blank\">https:\/\/github.com\/fogleman\/primitive<\/a><\/p>\n<p>\u4ee5\u4e0b\u5c31\u662f\u4e00\u4e9b\u6548\u679c\u793a\u610f\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201711\/shape2.jpg\" width=\"500\" height=\"331\" alt=\"primitive\u51e0\u4f55\u56fe\u5f62\u5316\u540e\u7684\u98ce\u666f\" class=\"alignnone\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201711\/shape3.jpg\" width=\"500\" height=\"406\" alt=\"primitive\u52a8\u7269-\u72ee\u5b50\" class=\"alignnone\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201711\/shape4.jpg\" width=\"500\" height=\"331\" alt=\"primitive\u4eba\u7269\u51e0\u4f55\u53d8\u6362\" class=\"alignnone\" \/><\/p>\n<p>\u6709macOS\u684c\u9762\u7248\u672c\uff0c<a href=\"https:\/\/primitive.lol\/\" rel=\"nofollow\" target=\"_blank\">https:\/\/primitive.lol\/<\/a>\u3002<\/p>\n<p>\u57fa\u4e8e\u539f\u59cb\u7684\u8fd9\u4e2aprimitive\u9879\u76ee\u7b97\u6cd5\uff0c\u5f88\u591a\u5f00\u53d1\u4eba\u5458\u62d3\u5c55\u4e86Java\u7248\u672c\uff0creact\u7248\u672c\u7b49\u3002\u81ea\u7136\u4e5f\u6709JavaScript\u7248\u672c\uff0c\u5c31\u662f\u672c\u6587\u8981\u4ecb\u7ecd\u7684primitive.js\u3002<\/p>\n<h3>\u4e8c\u3001\u4f4d\u56fe\u8f6c\u6362\u4e3a\u77e2\u91cf\u56feJS-primitive.js<\/h3>\n<p>\u9879\u76ee\u5730\u5740\u4e3a\uff1a<a href=\"https:\/\/github.com\/ondras\/primitive.js\" rel=\"nofollow\" target=\"_blank\">https:\/\/github.com\/ondras\/primitive.js<\/a><\/p>\n<p>\u53ef\u4ee5\u628a\u4efb\u610f\u4f4d\u56fe\u8f6c\u6362\u6210SVG\u77e2\u91cf\u56fe\uff0c\u6216\u8005\u51e0\u4f55\u98ce\u683cCanvas\u56fe\u7247\u3002<\/p>\n<p>\u8fd9\u662f\u5b98\u65b9\u4f53\u9a8c\u5730\u5740\uff1a<a href=\"https:\/\/ondras.github.io\/primitive.js\/\" rel=\"nofollow\" target=\"_blank\">https:\/\/ondras.github.io\/primitive.js\/<\/a>\uff0c\u7136\u540e\u6211\u82b1\u4e86\u4e2a\u628a\u5c0f\u65f6\u628a\u8fd9\u4e2a\u6f14\u793a\u9875\u9762\u7ffb\u8bd1\u6210\u4e86\u4e2d\u6587\uff0c\u622a\u56fe\u6548\u679c\u5982\u4e0b\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201711\/2017-11-29_234807.png\" width=\"519\" height=\"417\" alt=\"primitive.js\u6f14\u793a\u4e2d\u6587\u7248\" class=\"alignnone\" \/><\/p>\n<p>\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a href=\"http:\/\/www.zhangxinxu.com\/study\/201711\/demo-primitive-js-zh.html\" rel=\"noopener\" target=\"_blank\">primitive.js\u529f\u80fd\u53ca\u5404\u4e2a\u53c2\u6570\u6f14\u793a\u4e2d\u6587\u7248<\/a><\/p>\n<p>\u4f8b\u5982\uff0c\u6211\u4eec\u8bbe\u7f6e\u51e0\u4e2a\u5f62\u72b6\u4e2a\u6570\u4e3a200\u4e2a\uff0c\u5219\u6211\u4eec\u5bb6\u7684\u4f50\u4ed3\u5343\u4ee3\u5c31\u4f1a\u53d8\u5f97\u66f4\u6e05\u6670\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201711\/2017-11-30_000052.png\" width=\"399\" height=\"188\" alt=\"\u4f7f\u7528200\u4e2a\u51e0\u4f55\u5f62\u72b6\" class=\"alignnone\" \/> <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201711\/qidai-50-200.png\" width=\"301\" height=\"231\" alt=\"50\u51e0\u4f55\u56fe\u5f62vs200\u51e0\u4f55\u56fe\u5f62\" class=\"alignnone\" \/><\/p>\n<p>\u652f\u6301canvas\u548cSVG\u4e24\u79cd\u5448\u73b0\u6a21\u5f0f\uff0c\u524d\u8005\u4e0b\u8f7dPNG\u56fe\uff0c\u540e\u8005\u590d\u5236SVG\u4ee3\u7801\u3002<\/p>\n<p>\u7531\u4e8e\u4f4d\u56fe\u8f6c\u6362\u4e3a\u51e0\u4f55\u77e2\u91cf\u56fe\u8fd9\u4e2a\u64cd\u4f5c\u6bd4\u8f83\u70e7CPU\uff0c\u901a\u5e38\u9700\u8981\u660e\u663e\u7684\u7b49\u5f85\u65f6\u95f4\uff0c\u56e0\u6b64\uff0c\u76ee\u524d\u800c\u8a00\uff0c\u5e76\u4e0d\u9002\u5408\u5927\u89c4\u6a21\u7528\u5728\u9762\u5411\u7528\u6237\u7684\u9879\u76ee\u4e0a\uff0c\u6bd4\u8f83\u9002\u5408\u4f5c\u4e3a\u4e00\u4e2a\u9759\u6001\u5de5\u5177\u4f7f\u7528\u3002<\/p>\n<p>\u4f8b\u5982\u6211\u5e0c\u671b\u7f51\u9875\u7684banner\u5927\u56fe\u662f\u8fd9\u79cd\u51e0\u4f55\u98ce\u683c\u7684\uff0c\u5219\u5c31\u4e0d\u9700\u8981\u8bbe\u8ba1\u5e08\u518d\u53bb\u91cd\u65b0\u8bbe\u8ba1\uff0c\u76f4\u63a5\u4f7f\u7528\u4e00\u5f20\u7167\u7247\u8f6c\u6362\u4e00\u4e0b\u5c31\u53ef\u4ee5\u3002<\/p>\n<p>\u53e6\u5916\u4e00\u79cd\u5e94\u7528\u573a\u666f\u5c31\u662f\u505a\u52a8\u6548\uff0c\u5f53\u6211\u4eec\u628a\u4e00\u5f20\u7167\u7247\u8f6c\u6362\u6210SVG\u56fe\u7247\u4e4b\u540e\uff0c\u5219\u6bcf\u4e00\u6761<code>&lt;path&gt;<\/code>\u90fd\u662f\u53ef\u4ee5\u5b9e\u73b0\u586b\u5145\uff0c\u63cf\u8fb9\u7b49\u5f85\u52a8\u753b\u6548\u679c\uff0c\u4e8e\u662f\u5c31\u80fd\u5b9e\u73b0\u5f88\u591a\u4e4b\u524d\u6ca1\u89c1\u8fc7\u7684\u70ab\u9177\u6548\u679c\u3002<\/p>\n<p><strong>\u53ef\u5355\u72ec\u4f7f\u7528\u7684\u6539\u9020\u548c\u6f14\u793a<\/strong><br \/>\nGithub\u9879\u76ee\u4e2d\u7684primitive.js\u5b9e\u9645\u4e0a\u662f\u4e2aapp.js\uff0c\u4ee3\u7801\u548c\u6f14\u793a\u9875\u9762\u7684\u8bf8\u591a\u8868\u5355\u5143\u7d20\u90fd\u8026\u5408\u5728\u4e00\u8d77\u4e86\u3002\u5982\u679c\u6211\u4eec\u5e0c\u671b\u5355\u72ec\u5bf9\u67d0\u4e00\u5f20\u56fe\u7247\u8fdb\u884c\u63a7\u5236\uff0c\u800c\u4e0d\u505a\u8d70\u8fd9\u4e9b\u8868\u5355\u63a7\u4ef6\uff0c\u8be5\u600e\u4e48\u529e\uff1f<\/p>\n<p>\u4e8e\u662f\u6211\u5c31\u82b1\u4e86\u4e2a\u628a\u5c0f\u65f6\u72ec\u7acb\u51fa\u4e86\u53ef\u4ee5\u5728JS\u4e2d\u4f20\u9012\u53c2\u6570\u5bf9\u56fe\u5f62\u8fdb\u884c\u77e2\u91cf\u8f6c\u6362\u7684JS-<a href=\"http:\/\/www.zhangxinxu.com\/study\/201711\/primitive.js\" rel=\"noopener\" target=\"_blank\">primitive.js<\/a><\/p>\n<p>\u76f4\u63a5<code>&lt;script&gt;<\/code>\u5f15\u5165primitive.js\uff0c\u4f8b\u5982\uff1a<\/p>\n<pre>&lt;script src=\".\/primitive.js\"&gt;&lt;\/script&gt;<\/pre>\n<p>\u6b64\u65f6\uff0c\u4f1a\u5728\u5168\u5c40\u66b4\u9732\u4e00\u4e2a<code>PRIMITIVE<\/code>\u5bf9\u8c61\uff0c\u5176\u5305\u542b\u5c5e\u6027\u548c\u503c\u4e3a\uff1a<\/p>\n<pre>{\n    Canvas: Canvas,\n    Optimizer: Optimizer,\n    shapeMap: {\n        \"triangle\": Triangle,\n        \"rectangle\": Rectangle,\n        \"ellipse\": Ellipse,\n        \"smiley\": Smiley\n    }\n};<\/pre>\n<p>\u4f7f\u7528\u793a\u610f\u53ef\u4ee5\u53c2\u8003\u6b64demo\u6e90\u4ee3\u7801\uff0c\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a href=\"http:\/\/www.zhangxinxu.com\/study\/201711\/primitive-js-example.html\" rel=\"noopener\" target=\"_blank\">primitive.js\u7167\u7247\u53d8\u6210\u77e2\u91cfSVG\u56fe\u7247demo<\/a><\/p>\n<p>\u70b9\u51fbdemo\u9875\u9762\u7684\u201c\u70b9\u51fb\u53d8\u8eab\u201d\u6309\u94ae\uff0c\u5c31\u4f1a\u6709\u5982\u4e0b\u6548\u679c\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201711\/2017-11-30_001555.jpg\" width=\"242\" height=\"400\" alt=\"\u77e2\u91cf\u8f6c\u6362\u540e\u7684\u6548\u679c\" class=\"alignnone\" \/><\/p>\n<h3>\u4e09\u3001\u5176\u5b83\u4e00\u4e9b\u4f4d\u56fe\u53d8\u77e2\u91cf\u56fe\u8f6c\u6362JS<\/h3>\n<h4>1. geometrize-haxe-web\u9879\u76ee<\/h4>\n<p>\u8fd9\u4e2a\u4e5f\u662f\u57fa\u4e8eprimitive\u7b97\u6cd5\u6784\u5efa\u7684\u4e00\u4e2aJS\u8f6c\u6362\u5de5\u5177\uff0c\u9879\u76ee\u5730\u5740\uff1a<a href=\"https:\/\/github.com\/Tw1ddle\/geometrize-haxe-web\" rel=\"nofollow\" target=\"_blank\">https:\/\/github.com\/Tw1ddle\/geometrize-haxe-web<\/a><\/p>\n<p>\u91cd\u70b9\u8bf4\u4e0b\u8fd9\u4e2a\u9879\u76ee\u6784\u5efa\u5de5\u5177\uff1a\u8bbf\u95ee<a href=\"http:\/\/www.samcodes.co.uk\/project\/geometrize-haxe-web\/\" rel=\"nofollow\" target=\"_blank\">\u70b9\u51fb\u8fd9\u91cc<\/a>\u3002<\/p>\n<p>\u6b64\u5de5\u5177\u9875\u9762\u9ed8\u8ba4\u4f1a\u4ee5\u6700\u59277000\u56fe\u5f62\u91cf\u751f\u6210\u4e00\u4e2a\u6d77\u9e25\u7167\uff08\u70b9\u51fbsetting\u53ef\u4ee5\u6539\u53d8\u8bf8\u591a\u53c2\u6570\uff09\uff0c\u5f53\u7136\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u81ea\u5df1\u9009\u62e9\u672c\u5730\u56fe\u7247\uff0c1. open image, 2. run, 3. \u5dee\u4e0d\u591a\u56fe\u5f62\u8db3\u591f\u65f6\u5019pause. 4. \u4e0b\u8f7d\u56fe\u7247\u6216\u590d\u5236\u4ee3\u7801<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201711\/2017-11-30_002423.png\" width=\"552\" height=\"127\" alt=\"\u672c\u5730\u56fe\u5f62\u9009\u62e9\u793a\u610f\" class=\"alignnone\" \/><\/p>\n<p>\u4f8b\u5982\uff0c\u6211\u81ea\u5df1\u9753\u7167\uff0c\u8fd9\u662f3000+\u56fe\u5f62\u6784\u5efa\u7684\u6548\u679c\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201711\/2017-11-30_003543.jpg\" width=\"311\" height=\"378\" alt=\"3000\u591a\u51e0\u4f55\u56fe\u5f62\u6784\u5efa\u7684\u6548\u679c\" class=\"alignnone\" \/><\/p>\n<p>\u5df2\u7ecf\u975e\u5e38\u6709\u5199\u5b9e\u6d3e\u98ce\u683c\u753b\u4f5c\u7684\u611f\u89c9\u3002\u5c31demo\u6548\u679c\u800c\u8a00\uff0c\u5448\u73b0\u6548\u679c\u8981\u6bd4primitive.js\u66f4\u7ec6\u817b\u4e9b\u3002<\/p>\n<h4>2. \u7b80\u5355\u4f4d\u56fe\u8f6c\u77e2\u91cf-imagetracerjs<\/h4>\n<p>\u8fd9\u662f\u5b98\u65b9\u6548\u679c\u793a\u610f\u56fe\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201711\/s1.png\" width=\"600\" height=\"400\" alt=\"\u7b80\u5355\u4f4d\u56fe\u8f6c\u77e2\u91cfSVG\u793a\u610f\" class=\"alignnone\" \/><\/p>\n<p>imagetracerjs\u5c31\u662f\u4e00\u4e2a\u975e\u5e38\u5e72\u51c0\u7684JS\uff0c\u652f\u6301Node.js\uff0cAPI\u7b49\u5728<a href=\"https:\/\/github.com\/jankovicsandras\/imagetracerjs\" rel=\"nofollow\" target=\"_blank\">\u9879\u76ee\u9875<\/a>\u4e0a\u4e5f\u6709\u6bd4\u8f83\u8be6\u7ec6\u7684\u5c55\u793a\uff0c\u5c31\u4e0d\u8d58\u8ff0\uff0c\u5927\u5bb6\u6709\u5174\u8da3\u53ef\u81ea\u52a8\u67e5\u770b\u3002<\/p>\n<p>\u7136\u540e\uff0c\u6211\u7279\u610f\u505a\u4e86\u4e2ademo\u770b\u4e0b\u5982\u679c\u662f\u590d\u6742\u7684\u7167\u7247\u4f4d\u56fe\u8f6c\u6362\u540e\u7684\u6548\u679c\uff0c\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a href=\"http:\/\/www.zhangxinxu.com\/study\/201711\/imagetracer-js-example.html\" rel=\"noopener\" target=\"_blank\">imagetracer.js\u7167\u7247\u53d8\u6210\u77e2\u91cfSVG\u4f53\u9a8cdemo<\/a><\/p>\n<p>\u5206\u522b\u4f7f\u7528\u8272\u5f69\u4e30\u5bcc\u4f4d\u56fe\uff0c\u548c\u5c3a\u5bf8\u6781\u5c0f\u56fe\u6807\u4f4d\u56fe\u793a\u610f\uff0c\u7ed3\u679c\u5728\u8bbe\u5b9a\u5408\u9002\u7684<code>numberofcolors<\/code>\uff08\u8272\u503c\u6570\u91cf\uff09\u540e\u7684\u6548\u679c\u5927\u5927\u8d85\u51fa\u9884\u671f\u3002<\/p>\n<p>\u6548\u679c\u5982\u4e0b\u622a\u56fe\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201711\/2017-11-30_010439.jpg\" width=\"333\" height=\"560\" alt=\"imagetracer.js\u6548\u679c\u622a\u56fe\" class=\"alignnone\" \/><\/p>\n<p>\u76f8\u5173JS\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<pre>ImageTracer.imageToSVG(\n    '.\/ps1.jpg',\n    function(svgstr){ ImageTracer.appendSVGString( svgstr, 'svgcontainer' ); },\n    {numberofcolors: 256, scale:.5},\n    'Curvy'\n);\nImageTracer.imageToSVG(\n    '.\/icon-del.png',\n    function(svgstr){ ImageTracer.appendSVGString( svgstr, 'iconsvg' ); },\n    { ltres:0.1, qtres:0.1, scale:10, strokewidth:0, numberofcolors: 4 }\n);<\/pre>\n<p>\u867d\u7136\u9996\u5f20\u8272\u5f69\u4e30\u5bcc\u4f4d\u56fe\u8fd8\u539f\u6548\u679c\u633a\u597d\uff0c\u4f46\u662f\uff0c\u8f6c\u6362\u9700\u8981\u7684\u65f6\u95f4\u4e5f\u4e0d\u5c11\uff0c\u80fd\u660e\u663e\u611f\u89c9\u5230\u7b49\u5f85\u3002\u800c\u4e14\u8fd9\u79cd\u8fd8\u539f\u6548\u679c\u5e76\u4e0d\u5982\u51e0\u4f55\u56fe\u5f62\u6765\u7684\u5b9e\u5728\u3002<\/p>\n<p>\u7efc\u5408\u800c\u8a00\uff0cimagetracerjs\u9002\u5408\u7b80\u5355\u56fe\u7247\u7684\u77e2\u91cf\u5316\uff0c\u4f8b\u5982\uff0c1\u500dPNG\u56fe\u6807\u53d8\u6210\u77e2\u91cfSVG\u56fe\u6807\u3002\u6211\u89c9\u5f97\u8fd9\u8fd8\u633a\u6709\u610f\u601d\u7684\u3002<\/p>\n<h3>\u56db\u3001\u7ed3\u675f\u8bed<\/h3>\n<p>primitive.js\u9664\u4e86\u8ba9\u4f4d\u56fe\u77e2\u91cf\u5316\uff0c\u4e5f\u53ef\u4ee5\u8ba9\u77e2\u91cf\u56fe\u5f62\u51e0\u4f55\u5316\u3002\u4f8b\u5982\uff0c\u4e00\u4e9b\u6570\u5b57\u6216\u5b57\u6bcd\uff0c\u753b\u5728canvas\u4e0a\uff0c\u6b64\u65f6\u672c\u8d28\u4e0a\u5c31\u662f\u4f4d\u56fe\uff0c\u7136\u540e\u4f7f\u7528\u6b64\u5de5\u5177\u51e0\u4f55\u5316\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u5f97\u5230\u51e0\u4f55\u5316\u7684\u6570\u5b57\u6216\u5b57\u6bcd\u3002\u4e00\u4e9b\u7279\u6b8a\u573a\u5408\u5c31\u53ef\u4ee5\u5f88\u9177\u5730\u4f7f\u7528\u3002\u4f8b\u5982\uff0c10\u79d2\u5012\u8ba1\u65f6\u7b49\u7b49\u3002<\/p>\n<p>\u4ee5\u524d\u505a\u8fc7\u4e00\u4e2a\u5143\u7d20\u788e\u7247\u98de\u6e85\u52a8\u6548\uff1a<a href=\"http:\/\/www.zhangxinxu.com\/study\/201606\/clip-path-piece-fly-into.html\" target=\"_blank\">\u57fa\u4e8eclip-path\u7684\u5143\u7d20\u788e\u7247\u98de\u5165\u52a8\u6548demo<\/a><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201801\/2018-01-10_010803.png\" width=\"415\" height=\"665\" alt=\"\u4efb\u610f\u5143\u7d20\u788e\u7247\u98de\u5165\u6548\u679c\" class=\"alignnone\"><\/p>\n<p>\u4f60\u770b\uff0cprimitive.js\u53ef\u4ee5\u5f97\u5230\u51e0\u4f55\u5316\u788e\u7247\uff0c\u914d\u5408\u8fd9\u91cc\u7684\u52a8\u753b\u539f\u7406\uff0c\u5c82\u4e0d\u662f\u5f88\u591a\u9177\u9177\u7684\u6548\u679c\u5c31\u6709\u4e86\u3002<\/p>\n<p>\u591a\u591a\u79ef\u7d2f\uff0c\u591a\u591a\u7075\u611f\uff0c\u591a\u591a\u66f4\u597d\u7684\u4f53\u9a8c\uff01<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201611\/14.png\" align=\"absmiddle\"><\/p>\n<p>\u672c\u6587\u4e3a\u539f\u521b\u6587\u7ae0\uff0c\u4f1a\u7ecf\u5e38\u66f4\u65b0\u77e5\u8bc6\u70b9\u4ee5\u53ca\u4fee\u6b63\u4e00\u4e9b\u9519\u8bef\uff0c\u56e0\u6b64\u8f6c\u8f7d\u8bf7\u4fdd\u7559\u539f\u51fa\u5904\uff0c\u65b9\u4fbf\u6eaf\u6e90\uff0c\u907f\u514d\u9648\u65e7\u9519\u8bef\u77e5\u8bc6\u7684\u8bef\u5bfc\uff0c\u540c\u65f6\u6709\u66f4\u597d\u7684\u9605\u8bfb\u4f53\u9a8c\u3002<br \/>\n\u672c\u6587\u5730\u5740\uff1a<a href=\"http:\/\/www.zhangxinxu.com\/wordpress\/?p=6565\">http:\/\/www.zhangxinxu.com\/wordpress\/?p=6565<\/a><\/p>\n<p>\uff08\u672c\u7bc7\u5b8c\uff09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>primitive\u662f\u76f8\u5bf9\u6765\u8bf4\u6bd4\u8f83\u6709\u540d\u7684\u5c06\u7167\u7247\u56fe\u7247\u4f7f\u7528\u51e0\u4f55\u56fe\u5f62\u91cd\u5efa\u7684\u5de5\u5177\u3002\u57fa\u4e8e\u539f\u59cb\u7684\u8fd9\u4e2aprimitive\u9879\u76ee\u7b97\u6cd5\uff0c\u5f88\u591a\u5f00\u53d1\u4eba\u5458\u62d3\u5c55\u4e86Java\u7248\u672c\uff0creact\u7248\u672c\u7b49\u3002\u81ea\u7136\u4e5f\u6709JavaScript\u7248\u672c\uff0c\u5c31\u662f\u672c\u6587\u8981\u4ecb\u7ecd\u7684primitive.js\u3002\u4ee5\u53ca\u8fd8\u4f1a\u4ecb\u7ecd\u5176\u4ed6\u4e00\u4e9b\u4f4d\u56fe\u8f6c\u77e2\u91cf\u56feJS\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[896,895],"tags":[53,959,1190,642,204,917],"_links":{"self":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts\/6565"}],"collection":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/comments?post=6565"}],"version-history":[{"count":0,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts\/6565\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/media?parent=6565"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/categories?post=6565"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/tags?post=6565"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}