{"id":93589,"date":"2020-04-10T00:46:42","date_gmt":"2020-04-09T16:46:42","guid":{"rendered":"http:\/\/4563.org\/?p=93589"},"modified":"2020-04-10T00:46:42","modified_gmt":"2020-04-09T16:46:42","slug":"%e8%af%b7%e6%95%99%e4%b8%80%e4%b8%aa-vue-%e5%85%a8%e5%b1%80-css-%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=93589","title":{"rendered":"\u8bf7\u6559\u4e00\u4e2a vue \u5168\u5c40 css \u95ee\u9898"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u8bf7\u6559\u4e00\u4e2a vue \u5168\u5c40 css \u95ee\u9898               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : imherer <\/span>  <span><i><\/i> 20<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u9996\u5148\u6211\u7528\u4e86 vant \u8fd9\u4e2a\u6846\u67b6<\/p>\n<p>\u5728 A \u9875\u9762\u91cc\u6709\u5f88\u591a\u56fe\u7247\uff0c\u56fe\u7247\u663e\u793a\u7528\u7684\u662f vant \u91cc\u7684\u56fe\u7247\u7ec4\u4ef6\uff08 van-image \uff09\uff0c\u73b0\u5728\u9700\u8981\u7ed9\u56fe\u7247\u52a0\u4e0a\u5706\u89d2\uff0c\u4e8e\u662f\u6211\u5c31\u7528\u4e86\u5168\u5c40\u7684 css \uff08 scoped \u4e0d\u751f\u6548\uff09<\/p>\n<pre><code>&lt;style&gt; .van-image__img {   border-radius: 5px; } &lt;\/style&gt; <\/code><\/pre>\n<p>\u4ece A \u9875\u9762\u8df3\u8f6c\u5230 B \u9875\u9762\u540e\uff0cB \u9875\u9762\u4e5f\u6709\u5f88\u591a\u56fe\u7247\uff0c\u540c\u6837\u4e5f\u662f\u7528\u7684 van-image \u663e\u793a\u7684\uff0c\u73b0\u5728\u9700\u6c42\u662f B \u9875\u9762\u56fe\u7247\u4e0d\u80fd\u6709\u5706\u89d2\uff0c\u4e8e\u662f\u6211\u53c8\u5728 B \u9875\u9762\u91cc\u628a\u5706\u89d2\u53bb\u6389\uff1a<\/p>\n<pre><code>&lt;style&gt; .van-image__img {   border-radius: 0; } &lt;\/style&gt; <\/code><\/pre>\n<p>\u73b0\u5728\u7684\u95ee\u9898\u662f\u5f53\u4ece B \u9875\u9762\u8fd4\u56de\u5230 A \u9875\u9762\u7684\u65f6\u5019\uff0cA \u9875\u9762\u7684\u56fe\u7247\u5706\u89d2\u4e5f\u6ca1\u4e86\u3002\u5404\u4f4d\u5927\u4f6c\u5e94\u8be5\u5982\u4f55\u89e3\u51b3\u5462\uff1f<\/p>\n<p>\u73b0\u5728\u4e34\u65f6\u89e3\u51b3\u65b9\u6848\u662f AB \u4e24\u9875\u9762\u4e00\u4e2a\u9875\u9762\u7528\u539f\u59cb\u7684 img \u4e00\u4e2a\u9875\u9762\u7528 van-image<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>17<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"1153927\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ayase252 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             &#8230;&#8230;\u4e8c\u6b21\u5c01\u88c5\u4e00\u4e0b\u7ec4\u4ef6                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1153928\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : vex2 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5199\u4e24\u4e2a\u5168\u5c40 class \u52a0\u5230 component \u4e0d\u540c\u9875\u9762\u7684\u6307\u4ee4\u91cc                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1153929\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : cyrbuzz <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4ec5\u4ec5\u89e3\u51b3\u4e86\u8fd9\u4e2a\u95ee\u9898\u7684\u65b9\u6cd5&#8230;<br \/>\u7ed9 B \u91cc\u7684\u52a0 scoped&#8230;<\/p>\n<p>&#8220;`<br \/>&lt;style scoped&gt;<br \/>.van-image__img {<br \/> border-radius: 0;<br \/>}<br \/>&lt;\/style&gt;<br \/>&#8220;`                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1153930\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : imherer <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @ayase252 \u597d\u7684\uff0c\u6211\u53bb\u770b\u770b\u5982\u4f55\u5c01\u88c5<\/p>\n<p>\u6211\u4e00\u540e\u7aef\u2026\u2026\u786c\u751f\u751f\u88ab\u62c9\u6765\u5199\u524d\u7aef&#8230;                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1153931\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : just1 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u591a\u51e0\u5c42\u9009\u62e9\u5668\u54af\uff0c\u6bd4\u5982\u5f04\u4e00\u4e2a b \u72ec\u6709\u7684\u7236 class                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1153932\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ochatokori <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u7ed9 a \u9875\u9762\u52a0\u4e2a\u7c7b\u540d\u5457\u2026                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1153933\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : imherer <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @cyrbuzz \u8bd5\u8fc7\u4e86<br \/>.van-image__img \u662f vant \u6846\u67b6\u91cc css\uff0c\u5728 scoped \u91cc\u4e0d\u751f\u6548                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1153934\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : imherer <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @ochatokori <br \/>@vex2 <br \/>\u6211\u6700\u5f00\u59cb\u5c31\u60f3\u8fd9\u6837\u89e3\u51b3\uff0c\u4f46\u662f\u5b83\u8fd9\u4e2a van-image \u7ec4\u4ef6\u89e3\u6790\u4e4b\u540e\u662f\u4e00\u4e2a div \u91cc\u9762\u5957\u4e86\u4e00\u4e2a img\uff0c\u52a0\u4e86 clas \u662f\u76f4\u63a5\u52a0\u5230\u4e86 div \u4e0a\uff0c\u662f\u8fc7\u7528 css \u9009\u62e9\u5668\u7ed9\u5b50\u5143\u7d20\u6dfb\u52a0 css \u4e5f\u4e0d\u751f\u6548                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1153935\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : karott7 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u51fa\u73b0\u5c42\u4e3b\u8fd9\u6837\u7684\u95ee\u9898\u662f\u8bbf\u95ee A \u9875\u9762\u5c31\u4f1a\u52a0\u8f7d A \u9875\u9762\u7684 css \u6587\u4ef6\uff0c\u518d\u8bbf\u95ee B \u9875\u9762\u5c31\u4f1a\u52a0\u8f7d B \u9875\u9762\u7684 css \u6587\u4ef6\uff0c\u6709\u76f8\u540c\u7684\u5c5e\u6027\u5c31\u4f1a\u8986\u76d6\u6389\u3002<br \/>\u52a0 scoped \u662f\u4e00\u4e2a\u529e\u6cd5\uff0c\u4f46\u662f\u5982\u679c\u5728\u9876\u5c42\u5b9a\u4e49\u4e86\u4e00\u4e2a\u7c7b\uff0c\u90a3\u4e48\u5c31\u4e0d\u80fd\u7528\u3002<br \/>\u6211\u662f\u5728\u6bcf\u4e2a\u9875\u9762\u7684\u6839\u5143\u7d20\u52a0\u4e00\u4e2a\u7c7b\uff0c\u6bd4\u5982.a-wrapper \u548c.b-wrapper\uff0c\u7136\u540e a \u6587\u4ef6\u4e0b\u7684 css \u7c7b\u90fd\u5199\u5728\u5bf9\u5e94\u7684 wrapper \u4e0b\u9762\uff0c\u8fd9\u6837\u5c31\u4e0d\u4f1a\u51fa\u73b0\u5c42\u4e3b\u90a3\u6837\u7684\u95ee\u9898\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1153936\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Mozshaw <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \/deep\/ selector                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1153937\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : zhuweiyou <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5168\u5c40\u7684 CSS \u6587\u4ef6\u91cc\u5199\u4e2a<br \/>body.hello .van-image__img {<br \/> border-radius: 5px;<br \/>}<\/p>\n<p>\u7136\u540e\u5728 \u8def\u7531\u53d8\u5316\u7684\u94a9\u5b50\u91cc \u5224\u65ad \u662f A \u9875\u9762 body.addClass(&#8220;hello&#8221;),\u5176\u4ed6\u9875\u9762 body.removeClass(&#8220;hello&#8221;)                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1153938\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : jingcoco <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \/deep\/ \u4e86\u89e3\u4e00\u4e0b\u3002\u6211\u4e4b\u524d\u9047\u5230\u8fc7\u7c7b\u4f3c\u7684 \uff0cscoped \u5bfc\u81f4\u65e0\u6cd5\u7a7f\u900f\u7684\uff0c\u53ef\u4ee5\u7528\u8fd9\u4e2a\u505a\u524d\u7f00                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1153939\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : yeyeboy <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             scoped \u7a7f\u900f\u91cc\u9762\u7684\u7ec4\u4ef6\uff0c\u6211\u4e00\u822c\u662f\u5728\u56fe\u7247\u5916\u9762\u52a0\u4e00\u5c42\u5bb9\u5668\uff0c\u7136\u540e\u50cf\u4e0b\u9762\u8fd9\u6837<br \/>.van ::v-deep .van-image__img {<br \/> border-radius: 0;<br \/>}<br \/>= \uff0c= \u4f60\u8981\u662f\u6ca1\u522b\u7684\u529e\u6cd5\u53ef\u4ee5\u8bd5\u8bd5\u8fd9\u4e2a\uff08\u4e0d\u4fdd\u8bc1\u80fd\u7528\u54c8\uff09                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1153940\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : choujiaojiao <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \/deep\/                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1153941\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : xuxuxu123 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \/deep\/ \u662f\u5bf9\u7684<br \/>\u76ee\u524d\u5728\u7528                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1153942\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Parabolazz <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \/deep\/ \u53ef\u4ee5\u5728 scoped \u4e0b\u5f71\u54cd\u5230\u5185\u90e8\u7684\u9009\u62e9\u5668                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1153943\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : zhw2590582 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u7ed9\u4e0d\u540c\u9875\u9762\u5206\u914d\u4e0d\u540c\u7684\u7c7b\u540d\u5c31\u53ef\u4ee5\u533a\u5206\u5f00\u5566                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u8bf7\u6559\u4e00\u4e2a vue \u5168\u5c40 css \u95ee&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\/93589"}],"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=93589"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/93589\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=93589"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=93589"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=93589"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}