{"id":319713,"date":"2021-02-05T00:25:28","date_gmt":"2021-02-04T16:25:28","guid":{"rendered":"http:\/\/4563.org\/?p=319713"},"modified":"2021-02-06T03:29:12","modified_gmt":"2021-02-05T19:29:12","slug":"vue-js-%e7%9a%84-jsx-%e4%b8%ad%e7%9a%84-class-attribute-%e4%b8%ba%e4%bb%80%e4%b9%88%e7%94%a8-class%ef%bc%8c%e8%80%8c%e4%b8%8d%e5%83%8f-react-%e9%82%a3%e6%a0%b7%e7%94%a8-classname","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=319713","title":{"rendered":"Vue.js \u7684 JSX \u4e2d\u7684 class attribute \u4e3a\u4ec0\u4e48\u7528 class\uff0c\u800c\u4e0d\u50cf React \u90a3\u6837\u7528 className"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  Vue.js \u7684 JSX \u4e2d\u7684 class attribute \u4e3a\u4ec0\u4e48\u7528 class\uff0c\u800c\u4e0d\u50cf React \u90a3\u6837\u7528 className               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Cbdy <\/span>  <span><i><\/i> 6<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>React \u7ed9\u51fa\u7684\u89e3\u91ca\u662f class \u662f JavaScript \u7684\u4fdd\u7559\u5b57<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>18<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"5112303\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : kyuuseiryuu <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u56e0\u4e3a react \u662f HTML in js\uff0c\u672c\u8d28\u4e0a\u8fd8\u662f js \u3002<\/p>\n<p>vue \u662f HTML \u6807\u7b7e\u7684\u62d3\u5c55\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5112304\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : hackyuan <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8fd9\u4e2a\u4f60\u90fd\u81ea\u95ee\u81ea\u7b54\u4e86\uff0c`class \u662f Javascript \u7684\u4fdd\u7559\u5b57`\u3002<br \/>\u800c HTML \u4e2d\u53ea\u662f\u6807\u7b7e\u4e0a\u7684\u4e00\u4e2a\u5c5e\u6027\u800c\u5df2\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5112305\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : David1119 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u96be\u9053\u4e0d\u5e94\u8be5\u53cd\u8fc7\u6765\u95ee\u5417\uff1f\u600e\u4e48\u53cd\u800c\u6210\u4e86 vue \u4e0d\u5bf9\u4e86\u3002\u3002\u3002\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5112306\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : anguiao <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u53cd\u6b63\u90fd\u5f97\u7ecf\u8fc7 Babel \u8f6c\u8bd1\u561b\uff0c\u6211\u89c9\u5f97\u6ca1\u5dee\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5112307\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : hjdtl <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e00\u6b63\u786e\uff0c\u6b64\u8d34\u7ec8\u7ed3                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5112308\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : murmur <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u56e0\u4e3a\u5728 html \u91cc\u5c31\u662f class \u554a\uff0creact \u624d\u662f\u4e3a\u4e86\u5077\u61d2\u5565\u5c01\u88c5\u90fd\u4e0d\u505a                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5112309\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : mebtte <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u522b\u95ee, \u95ee\u5c31\u662f\u65b0\u7684\u8bed\u6cd5 \u65b0\u7684\u4f53\u9a8c                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5112310\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : shintendo <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6b63\u786e\u7684\u95ee\u6cd5\uff1a\u4e3a\u4ec0\u4e48 React \u8981\u7528 className \u800c\u4e0d\u662f\u8ddf HTML \u4e00\u6837\u7528 class\uff0c\u660e\u660e vue \u7684 JSX \u8bc1\u660e\u4e86\u4fdd\u7559\u5b57\u4e0d\u662f\u95ee\u9898                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5112311\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : molvqingtai <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e0a\u6b63\u89e3\uff0c\u56e0\u4e3a React \u56e2\u961f\u5077\u61d2 <img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2021\/02\/504J5BO2-89.png\" alt=\"Vue.js \u7684 JSX \u4e2d\u7684 class attribute \u4e3a\u4ec0\u4e48\u7528 class\uff0c\u800c\u4e0d\u50cf React \u90a3\u6837\u7528 className\"> <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5112312\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : yaphets666 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             vue \u7684\u601d\u8def\u662f\u5c3d\u91cf\u4fdd\u8bc1\u548c\u539f\u59cb HTML,JS,CSS \u4e00\u81f4.<br \/>template \u91cc\u5934\u7684\u4e1c\u897f\u79f0\u4f5c\u4e3a\u6a21\u677f,\u4f1a\u7ecf\u8fc7 vue-loader \u7684\u5904\u7406.\u5199\u4ec0\u4e48\u90fd\u53ef\u4ee5.<br \/>class \u548c\u539f\u751f\u4e00\u6837,\u5e76\u4e14\u610f\u4e49\u662f\u4e00\u81f4\u7684,\u5c31\u662f\u6dfb\u52a0\u7c7b\u540d,\u5f53\u7136\u9009\u62e9 class \u66f4\u7b26\u5408\u76f4\u89c9.<br \/>\u8fd9\u5c31\u662f vue \u66f4\u52a0\u7b80\u5355,\u5bb9\u6613\u5b66\u4e60\u7684\u539f\u56e0.\u5c3d\u91cf\u505a\u7684\u548c\u539f\u751f\u4e00\u6837.                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5112313\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : soulmt <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8fd9\u4e8b\u53c8\u6ca1\u6709\u6807\u51c6\u7b54\u6848\uff0c\u90fd\u662f\u5f00\u53d1\u8005\u57fa\u4e8e\u81ea\u5df1\u7684\u903b\u8f91\u6765\u7ea6\u5b9a\u7684\u800c\u5df2\uff0c \u4e0d\u7528\u592a\u8fc7\u4e8e\u7ea0\u7ed3\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5112314\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : robinlovemaggie <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8bf4\u5230\u8fd9\u4e2a\u5c31\u8981\u5228\u6839\u7a76\u5e95 React \u548c Vue \u672c\u8d28\u4e0a\u4e0d\u540c\u4e4b\u5904\u4e86\uff1a<br \/>1.React \u662f\u4e2a\u5e93(library), \u800c Vue \u662f\u4e2a\u6846\u67b6(Framework)<br \/>2.\u72b6\u6001\u53d8\u66f4(Data Mutation)\u4e0d\u540c\uff0cReact \u662f\u88ab\u52a8\u5f0f(setState)\u7ed9\u7528\u6237\u81ea\u4e3b\u6743\uff0cVue \u662f\u4e3b\u52a8 re-rendering,\u7528\u6237\u65e0\u6cd5\u63a7\u5236\u6e32\u67d3\u65f6\u673a\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5112315\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : seki <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             className \u662f\u65e9\u671f\u65f6\u5019 API \u8bbe\u8ba1\u7684\u51b3\u5b9a\uff0c\u73b0\u5728\u6765\u770b\u5176\u5b9e\u672c\u6765\u7528 class \u4e5f\u662f\u6ca1\u6709\u95ee\u9898\u7684\u3002react \u5f00\u53d1\u56e2\u961f\u4e5f\u6709\u8fc7\u66f4\u6539\u8bbe\u8ba1\u7684\u60f3\u6cd5\uff0c\u867d\u7136\u76ee\u524d\u6ca1\u6709\u4ec0\u4e48\u65b0\u6d88\u606f\u3002\u91c7\u7528\u7c7b react API \u7684 preact \u5c31\u662f\u7528\u7684 class<\/p>\n<p>\u8fd9\u79cd\u4e8b\u60c5\u6ca1\u6709\u5fc5\u8981\u62d4\u5f97\u592a\u9ad8\u2026\u2026                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5112316\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Biwood <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5148\u641e\u6e05\u695a\u4e00\u4e2a\u6982\u5ff5\uff0cVue \u91cc\u9762\u90a3\u4e2a\u4e0d\u662f JSX\uff0c\u662f template\uff0c\u7528\u7684\u662f HTML \u8bed\u6cd5\u3002<br \/>React \u91cc\u9762\u90a3\u4e2a\u624d\u53eb JSX\uff0c\u7528\u7684\u662f JavaScript \u8bed\u6cd5\u3002<br \/>html \u8bed\u6cd5\u91cc\u9762\u7528 class\uff0cJS \u8bed\u6cd5\u91cc\u9762\u7528 className\uff0c\u5f88\u6b63\u5e38\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5112317\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : shintendo <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @Biwood \u5148\u641e\u6e05\u695a\u4e00\u4e2a\u6982\u5ff5\uff0cVue \u652f\u6301 JSX                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5112318\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Biwood <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @shintendo #15 <br \/>Vue \u91cc\u9762\u6240\u8c13\u7684 JSX \u53ea\u80fd\u7b97\u662f template \u7684\u8bed\u6cd5\u7cd6\uff0c\u8fd9\u8ddf React \u91cc\u9762\u4e00\u5207\u7686\u7528 JS \u5199\u7684\u7406\u5ff5\u4e0d\u4e00\u6837\u3002<br \/>\u786c\u8981\u5228\u6839\u95ee\u5e95\uff0c\u6211\u89c9\u5f97\u672c\u8d28\u4e0a\u5c31\u662f template \u8bed\u6cd5\u8ddf JavaScript \u8bed\u6cd5\u7684\u533a\u522b\uff0c\u6bd5\u7adf Vue \u7684 template \u6a21\u5f0f\u7ee7\u627f\u81ea Angular\uff0c\u800c React \u4e0d\u662f\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5112319\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : shintendo <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @Biwood template \u662f render funtion \u7684\u8bed\u6cd5\u7cd6\uff0cJSX \u4e5f\u662f render function \u7684\u8bed\u6cd5\u7cd6\uff0c\u8fd9\u4e00\u70b9\u548c React \u7684 JSX \u5e76\u6ca1\u6709\u672c\u8d28\u533a\u522b                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5112320\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : assclb <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @Biwood #17 \u8bb2\u7684\u6ca1\u9519\uff0cvue \u91cc\u9762\u4e0d\u7ba1\u662f jsx \u8fd8\u662f template \u90fd\u662f render function \u7684\u8bed\u6cd5\u7cd6&#8230;                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>Vue.js \u7684 JSX \u4e2d\u7684 c&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\/319713"}],"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=319713"}],"version-history":[{"count":1,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/319713\/revisions"}],"predecessor-version":[{"id":319715,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/319713\/revisions\/319715"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=319713"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=319713"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=319713"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}