{"id":4029,"date":"2023-02-08T21:42:56","date_gmt":"2023-02-08T13:42:56","guid":{"rendered":"https:\/\/blog.odjbinail.cn\/?p=4029"},"modified":"2026-01-07T20:40:40","modified_gmt":"2026-01-07T12:40:40","slug":"%e7%a7%af%e7%b4%af%e5%89%8d%e7%ab%af%e5%86%99%e6%b3%95-%e6%a1%88%e4%be%8b","status":"publish","type":"post","link":"https:\/\/blog.odjbinail.cn\/?p=4029","title":{"rendered":"\u79ef\u7d2f\u524d\u7aef\u5199\u6cd5\/\u6848\u4f8b"},"content":{"rendered":"<h2>1.\u54cd\u5e94\u5f0f\u5e03\u5c40 REM<\/h2>\n<ul>\n<li>\n<p>\u5b89\u88c5: npm install lib-flexible<\/p>\n<ul>\n<li>\u5728 main.js \u5bfc\u5165 import 'lib-flexible\/flexible.js'<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>npm install postcss-plugin-px2rem -D<\/p>\n<ul>\n<li>\u5728 vue.config.js \u5bfc\u5165<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><img data-original=\"https:\/\/blog.odjbinail.cn\/wp-content\/uploads\/2023\/02\/2023020615452089.png\"  alt=\"\" \/><\/p>\n<noscript><img decoding=\"async\" src=\"https:\/\/blog.odjbinail.cn\/wp-content\/uploads\/2023\/02\/2023020615452089.png\" alt=\"\" \/><\/p><\/noscript>\n<ul>\n<li>rootValue: 37.5  [ \u8bbe\u8ba1\u7a3f\u7684\u5927\u5c0f \/ 10 ]<\/li>\n<li>exclude : [ \u5bf9\u4e8e\u90a3\u4e2a\u76ee\u5f55\u6392\u9664\u5728\u5916 ]<\/li>\n<li>minPixelValue : 3 [ \u8fd9\u4e2a\u63d2\u4ef6\u53ea\u5bf9 3px \u53ca\u4ee5\u4e0a\u7684\u5185\u5bb9\u624d\u751f\u6548 ]<\/li>\n<\/ul>\n<h2>2.SVGIcon<\/h2>\n<ul>\n<li>Svg \u652f\u6301\u591a\u8272\u56fe\u6807<\/li>\n<li>Svg \u53ef\u4ee5\u63a7\u5236\u56fe\u6807\u4e0d\u540c\u90e8\u5206, \u52a0\u5165\u52a8\u753b<\/li>\n<li>Svg \u662f\u77e2\u91cf\u56fe\u5f62, \u56fe\u6807\u9510\u5229, \u4f53\u79ef\u66f4\u5c0f<\/li>\n<li>\u5236\u4f5c SvgIcon \u7684\u5e73\u53f0 <strong>IconPark<\/strong><\/li>\n<\/ul>\n<h2>3.\u7eaf CSS \u5b9e\u73b0\u8f6e\u64ad\u56fe<\/h2>\n<p><img data-original=\"https:\/\/blog.odjbinail.cn\/wp-content\/uploads\/2023\/02\/2023020616023417.png\"  alt=\"\" \/><\/p>\n<noscript><img decoding=\"async\" src=\"https:\/\/blog.odjbinail.cn\/wp-content\/uploads\/2023\/02\/2023020616023417.png\" alt=\"\" \/><\/p><\/noscript>\n<pre class=\"prettyprint linenums\" ><code>&lt;template&gt;\n  &lt;div class=&quot;box&quot;&gt;\n    &lt;div class=&quot;box__item bg1&quot;&gt;&lt;\/div&gt;\n    &lt;div class=&quot;box__item bg2&quot;&gt;&lt;\/div&gt;\n    &lt;div class=&quot;box__item bg3&quot;&gt;&lt;\/div&gt;\n    &lt;div class=&quot;box__item bg4&quot;&gt;&lt;\/div&gt;\n  &lt;\/div&gt;\n&lt;\/template&gt;\n\n&lt;style scoped lang=&quot;scss&quot;&gt;\n&lt;template&gt;\n  &lt;div class=&quot;box&quot;&gt;\n    &lt;div class=&quot;box__item bg1&quot;&gt;&lt;\/div&gt;\n    &lt;div class=&quot;box__item bg2&quot;&gt;&lt;\/div&gt;\n    &lt;div class=&quot;box__item bg3&quot;&gt;&lt;\/div&gt;\n    &lt;div class=&quot;box__item bg4&quot;&gt;&lt;\/div&gt;\n  &lt;\/div&gt;\n  &lt;div font-feichi style=&quot;font-size: 50px&quot;&gt;\u4eca\u65e5\u5fc5\u62a2&lt;\/div&gt;\n&lt;\/template&gt;\n\n&lt;style scoped lang=&quot;scss&quot;&gt;\n.box {\n  overflow: auto;\n  white-space: nowrap;\n  scroll-snap-type: x mandatory;\n\n  &amp;__item {\n    display: inline-block;\n    background: pink;\n    width: 100%;\n    height: 100px;\n    scroll-snap-align: center;\n    \/\/\u62d6\u52a8\u4e0d\u80fd\u8df3\u8fc7\n    scroll-snap-stop: always;\n  }\n\n  .bg1 {\n    background: pink;\n  }\n\n  .bg2 {\n    background: yellow;\n  }\n\n  .bg3 {\n    background: blue;\n  }\n\n  .bg4 {\n    background: black;\n  }\n}\n&lt;\/style&gt;<\/code><\/pre>\n<p><img data-original=\"https:\/\/blog.odjbinail.cn\/wp-content\/uploads\/2023\/02\/2023020616464755.png\"  alt=\"\" \/><\/p>\n<noscript><img decoding=\"async\" src=\"https:\/\/blog.odjbinail.cn\/wp-content\/uploads\/2023\/02\/2023020616464755.png\" alt=\"\" \/><\/p><\/noscript>\n<p><img data-original=\"https:\/\/blog.odjbinail.cn\/wp-content\/uploads\/2023\/02\/2023020616473517.png\"  alt=\"\" \/><\/p>\n<noscript><img decoding=\"async\" src=\"https:\/\/blog.odjbinail.cn\/wp-content\/uploads\/2023\/02\/2023020616473517.png\" alt=\"\" \/><\/p><\/noscript>\n<h2>4.border-radius \u539f\u7406\u53ca\u5b9e\u73b0\u590d\u6742\u56fe\u5f62<\/h2>\n<p><img data-original=\"https:\/\/blog.odjbinail.cn\/wp-content\/uploads\/2023\/02\/2023020616495764.png\"  alt=\"\" \/><\/p>\n<noscript><img decoding=\"async\" src=\"https:\/\/blog.odjbinail.cn\/wp-content\/uploads\/2023\/02\/2023020616495764.png\" alt=\"\" \/><\/p><\/noscript>\n<p><img data-original=\"https:\/\/blog.odjbinail.cn\/wp-content\/uploads\/2023\/02\/2023020616534021.png\"  alt=\"\" \/><\/p>\n<noscript><img decoding=\"async\" src=\"https:\/\/blog.odjbinail.cn\/wp-content\/uploads\/2023\/02\/2023020616534021.png\" alt=\"\" \/><\/p><\/noscript>\n<p><img data-original=\"https:\/\/blog.odjbinail.cn\/wp-content\/uploads\/2023\/02\/2023020616550580.png\"  alt=\"\" \/><\/p>\n<noscript><img decoding=\"async\" src=\"https:\/\/blog.odjbinail.cn\/wp-content\/uploads\/2023\/02\/2023020616550580.png\" alt=\"\" \/><\/p><\/noscript>\n<h2>5.vue-\u94c3\u94db\u52a0\u7ea2\u70b9<\/h2>\n<pre class=\"prettyprint linenums\" ><code>&lt;div id=&quot;bell&quot; &gt;\n            &lt;div  class=&quot;el-icon-bell bell&quot;&gt;&lt;i class=&quot;dots&quot;&gt;&lt;\/i&gt;&lt;\/div&gt;\n&lt;\/div&gt;<\/code><\/pre>\n<pre class=\"prettyprint linenums\" ><code>    #bell {\n      position: absolute;\n      right: 192px;\n      padding-top: 3px;\n      \/\/margin-top: 4px;\n      .bell {\n        padding: 3px 7px 0 7px;\n        display: inline-block;\n        font-size: 21px;\n        color: #000000;\n        font-weight: bold;\n        position: relative;\n      }\n\n      .dots {\n        display: block;\n        background: #f00;\n        border-radius: 50%;\n        width: 0.3em;\n        height: 0.3em;\n        top: 0;\n        right: 6px;\n        position: absolute;\n      }\n    }<\/code><\/pre>\n<h2>6.vue-\u624b\u5199\u516c\u544a\u6761<\/h2>\n<pre class=\"prettyprint linenums\" ><code>1\u3001\u5355\u884c\u6587\u672c\u6ea2\u51fa\u663e\u793a\u7701\u7565\u53f7\noverflow: hidden;\uff08\u6587\u5b57\u957f\u5ea6\u8d85\u51fa\u9650\u5b9a\u5bbd\u5ea6\uff0c\u5219\u9690\u85cf\u8d85\u51fa\u7684\u5185\u5bb9\uff09\nwhite-space: nowrap;\uff08\u8bbe\u7f6e\u6587\u5b57\u5728\u4e00\u884c\u663e\u793a\uff0c\u4e0d\u80fd\u6362\u884c\uff09\ntext-overflow: ellipsis;\uff08\u89c4\u5b9a\u5f53\u6587\u672c\u6ea2\u51fa\u65f6\uff0c\u663e\u793a\u7701\u7565\u7b26\u53f7\u6765\u4ee3\u8868\u88ab\u4fee\u526a\u7684\u6587\u672c\uff09\n\n 2\u3001\u591a\u884c\u6587\u672c\u6ea2\u51fa\u663e\u793a\u7701\u7565\u53f7\n-webkit-line-clamp: 2;\uff08\u7528\u6765\u9650\u5236\u5728\u4e00\u4e2a\u5757\u5143\u7d20\u663e\u793a\u7684\u6587\u672c\u7684\u884c\u6570\uff0c2 \u8868\u793a\u6700\u591a\u663e\u793a 2 \u884c\u3002\u4e3a\u4e86\u5b9e\u73b0\u8be5\u6548\u679c\uff0c\u5b83\u9700\u8981\u7ec4\u5408\u5176\u4ed6\u7684 WebKit \u5c5e\u6027\uff09\ndisplay: -webkit-box;\uff08\u548c 1 \u7ed3\u5408\u4f7f\u7528\uff0c\u5c06\u5bf9\u8c61\u4f5c\u4e3a\u5f39\u6027\u4f38\u7f29\u76d2\u5b50\u6a21\u578b\u663e\u793a \uff09\n-webkit-box-orient: vertical;\uff08\u548c 1 \u7ed3\u5408\u4f7f\u7528 \uff0c\u8bbe\u7f6e\u6216\u68c0\u7d22\u4f38\u7f29\u76d2\u5bf9\u8c61\u7684\u5b50\u5143\u7d20\u7684\u6392\u5217\u65b9\u5f0f \uff09\noverflow: hidden;\uff08\u6587\u672c\u6ea2\u51fa\u9650\u5b9a\u7684\u5bbd\u5ea6\u5c31\u9690\u85cf\u5185\u5bb9\uff09\ntext-overflow: ellipsis;\uff08\u591a\u884c\u6587\u672c\u7684\u60c5\u51b5\u4e0b\uff0c\u7528\u7701\u7565\u53f7 \u201c\u2026\u201d \u9690\u85cf\u6ea2\u51fa\u8303\u56f4\u7684\u6587\u672c)<\/code><\/pre>\n<pre class=\"prettyprint linenums\" ><code> &lt;div id=&quot;bell_block&quot; @mouseleave=&quot;closeBellBlock&quot;&gt;\n      &lt;ul&gt;\n        &lt;li v-for=&quot;(item,index) in 20&quot; :key=&quot;index&quot;&gt;\n          &lt;span @click=&quot;openBox&quot;&gt;\u7b2c 1 \u6761\u901a\u544a\u7b2c 1 \u6761\u901a\u544a\u7b2c 1 \u6761\u901a\u544a\u7b2c 1 \u6761\u901a\u544a\u7b2c 1 \u6761\u901a\u544a\u7b2c 1 \u6761\u901a\u544a\u7b2c 1 \u6761\u901a\u544a\u7b2c 1 \u6761\u901a\u544a\u7b2c 1 \u6761\u901a\u544a\u7b2c 1 \u6761\u901a\u544a&lt;i\n            class=&quot;dots&quot;\n          &gt;&lt;\/i&gt;&lt;\/span&gt;\n          &lt;el-button type=&quot;danger&quot; size=&quot;mini&quot; icon=&quot;el-icon-delete&quot; circle&gt;&lt;\/el-button&gt;\n        &lt;\/li&gt;\n      &lt;\/ul&gt;\n    &lt;\/div&gt;<\/code><\/pre>\n<pre class=\"prettyprint linenums\" ><code>#bell_block::-webkit-scrollbar{\n  width: 6px;\n  background-color: #f8f8f8;\n}\n#bell_block::-webkit-scrollbar-thumb{\n  width: 6px;\n  background-color: #adacac;\n  border-radius: 4px;\n}\n#bell_block {\n  \/\/display: inline-block;\n  width: 250px;\n  height: 400px;\n  position: absolute;\n  right: 80px;\n  top: 51px;\n  background-color: #FFFFFF;\n  box-shadow: 4px 4px 15px #d7d3d3;\n  word-wrap: break-word;\n  overflow: hidden;\n  padding: 0 10px 0 10px;\n  z-index: 99999;\n  display: none;\n  overflow-y: auto;\n  ul {\n    padding: 0!important;\n    li {\n      display: flex;\n      justify-content: space-between;\n      padding-bottom: 10px;\n      span {\n        list-style-type: none;\n        color: #000;\n        font-size: 16px;\n        letter-spacing: 0.2px;\n        overflow: hidden;\n        white-space: nowrap;\n        text-overflow: ellipsis;\n        line-height: 26px;\n        position: relative;\n        cursor: pointer;\n        .dots {\n          display: block;\n          background: #f00;\n          border-radius: 50%;\n          width: 0.3em;\n          height: 0.3em;\n          top: 3px;\n          right: 9px;\n          position: absolute;\n        }\n      }\n\n      button {\n        width: 26px;\n        height: 26px;\n        font-size: 12px;\n        margin-top: -3px;\n        \/\/line-height: 26px;\n        \/\/margin-left: 3px;\n      }\n    }\n  }\n}<\/code><\/pre>\n<h2>7.\u52a8\u753b\u6eda\u52a8<\/h2>\n<pre class=\"prettyprint linenums\" ><code> &lt;div id=&quot;notice&quot;&gt;\n        &lt;span id=&quot;notice_text&quot;&gt;1111222222222222222222222222222222222222223333333333333&lt;\/span&gt;\n      &lt;\/div&gt;<\/code><\/pre>\n<pre class=\"prettyprint linenums\" ><code> #notice {\n    position: absolute;\n    top: 20px;\n    left: 300px;\n    \/\/width: 950px;\n    width: 63%;\n    overflow: hidden;\n\n    #notice_text {\n      margin-left: 100%;\n      animation: 3s linear 0.1s slidein;\n    }\n  }<\/code><\/pre>\n<h2>8.\u5f53\u4f7f\u7528 scss \u5e03\u5c40\u65f6,\u53d6\u6d88\u6700\u540e\u4e00\u5757\u7684\u6709\u8fb9\u6846,\u6682\u65f6\u53d6\u6d88\u4e0d\u6210,,\u91c7\u7528\u5faa\u73af\u65f6 v-for,\u53ef\u4ee5\u91c7\u53d6\u4e0b\u5217\u65b9\u5f0f[F12 \u8c03\u8bd5\u4e2d\u7684\u6807\u7b7e\u7ea7\u522b,\u5199\u5355\u72ec\u7684\u6837\u5f0f]<\/h2>\n<pre class=\"prettyprint linenums\" ><code>&lt;el-col :span=&quot;6&quot; v-for=&quot;(item,index) in newsData&quot; :key=&quot;index&quot; :class=&quot;&#039;border_right-&#039; + (index + 1)&quot;&gt;\n\n.border_right-4{\n  .news_context{\n    .news_context_text{\n      border-right: none!important;\n    }\n  }\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>1.\u54cd\u5e94\u5f0f\u5e03\u5c40 REM \u5b89\u88c5: npm install lib-flexible \u5728 main.js \u5bfc\u5165 i [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-4029","post","type-post","status-publish","format-standard","hentry","category-web"],"_links":{"self":[{"href":"https:\/\/blog.odjbinail.cn\/index.php?rest_route=\/wp\/v2\/posts\/4029","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.odjbinail.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.odjbinail.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.odjbinail.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.odjbinail.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4029"}],"version-history":[{"count":15,"href":"https:\/\/blog.odjbinail.cn\/index.php?rest_route=\/wp\/v2\/posts\/4029\/revisions"}],"predecessor-version":[{"id":5209,"href":"https:\/\/blog.odjbinail.cn\/index.php?rest_route=\/wp\/v2\/posts\/4029\/revisions\/5209"}],"wp:attachment":[{"href":"https:\/\/blog.odjbinail.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4029"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.odjbinail.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4029"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.odjbinail.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4029"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}