{"id":2986,"date":"2020-06-04T18:19:14","date_gmt":"2020-06-04T10:19:14","guid":{"rendered":"http:\/\/www.yuguoxy.com\/geekhome\/?p=2986"},"modified":"2020-06-04T18:19:59","modified_gmt":"2020-06-04T10:19:59","slug":"%e5%89%8d%e7%ab%af%e5%8a%a8%e7%94%bb%e5%bf%85%e7%9f%a5%e5%bf%85%e4%bc%9a%ef%bc%9areact-%e5%92%8c-vue-%e9%83%bd%e5%9c%a8%e7%94%a8%e7%9a%84-flip-%e6%80%9d%e6%83%b3%e5%ae%9e%e6%88%98%e3%80%82","status":"publish","type":"post","link":"https:\/\/ai.zhousir.top\/?p=2986","title":{"rendered":"\u524d\u7aef\u52a8\u753b\u5fc5\u77e5\u5fc5\u4f1a\uff1aReact \u548c Vue \u90fd\u5728\u7528\u7684 FLIP \u601d\u60f3\u5b9e\u6218\u3002"},"content":{"rendered":"<h2>\u524d\u8a00<\/h2>\n<p>\u5728 Vue \u7684\u5b98\u7f51\u4e2d\u7684\u8fc7\u6e21\u52a8\u753b\u7ae0\u8282\u4e2d\uff0c\u53ef\u4ee5\u770b\u5230\u4e00\u4e2a\u5f88\u9177\u70ab\u7684\u52a8\u753b\u6548\u679c<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-2987\" src=\"https:\/\/ai.zhousir.top\/wp-content\/uploads\/2020\/06\/flip1.gif\" alt=\"flip1\" width=\"640\" height=\"618\" \/><\/p>\n<p>\u4e4d\u4e00\u770b\uff0c\u8ba9\u6211\u4eec\u624b\u5199\u51fa\u8fd9\u4e2a\u903b\u8f91\u5e94\u8be5\u662f\u975e\u5e38\u590d\u6742\u7684\u3002\u4f46\u662f\u6587\u6863\u91cc\u6211\u4eec\u53d1\u73b0\u4e00\u4e2a\u540d\u8bcd\uff1a<code>FLIP<\/code>\uff0c\u8fd9\u7ed9\u4e86\u6211\u4eec\u4e00\u4e2a\u7ebf\u7d22\uff0c\u662f\u4e0d\u662f\u7528\u8fd9\u4e2a\u73a9\u610f\u5c31\u53ef\u4ee5\u5199\u51fa\u8fd9\u4e2a\u52a8\u753b\u5462\uff1f<\/p>\n<p>\u7b54\u6848\u662f\u80af\u5b9a\u7684\uff0c\u987a\u7740\u8fd9\u4e2a\u7ebf\u7d22\u627e\u5230 <code>Aerotwist<\/code> \u793e\u533a\u91cc\u7684\u4e00\u7bc7\u6587\u7ae0\uff1aflip-your-animations\uff0c\u4ee5\u8fd9\u7bc7\u6587\u7ae0\u4e3a\u5207\u5165\u70b9\uff0c\u4e00\u6b65\u6b65\u6765\u5b9e\u73b0\u4e00\u4e2a\u7c7b\u4f3c\u7684\u6548\u679c\u3002<\/p>\n<p>\u56fe\u7247\u7d20\u6750\u4f9d\u7136\u5f15\u7528\u81ea\u77e5\u4e4e\u95ee\u9898\u300a\u6709\u4e2a\u6f02\u4eae\u5973\u670b\u53cb\u662f\u79cd\u600e\u6837\u7684\u4f53\u9a8c\uff1f\u300b\uff0c\u4fb5\u5220\u3002<\/p>\n<h2>\u9884\u89c8<\/h2>\n<p>\u5148\u6765\u770b\u770b\u672c\u6587\u60f3\u8981\u5b9e\u73b0\u7684\u6700\u7ec8\u6548\u679c\u662f\u4ec0\u4e48\u6837\u5427\uff1a<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-2988\" src=\"https:\/\/ai.zhousir.top\/wp-content\/uploads\/2020\/06\/flip4.gif\" alt=\"flip4\" width=\"479\" height=\"461\" \/><\/p>\n<p>\u4e5f\u53ef\u4ee5\u76f4\u63a5\u8fdb\u9884\u89c8\u7f51\u5740\u91cc\u770b\uff1a<\/p>\n<p><a class=\"url\" href=\"http:\/\/sl1673495.gitee.io\/flip-animation\" target=\"_blank\">http:\/\/sl1673495.gitee.io\/flip-animation<\/a><\/p>\n<h2>FLIP<\/h2>\n<p><code>FLIP<\/code> \u7a76\u7adf\u662f\u4ec0\u4e48\u4e1c\u897f\u5462\uff1f\u5148\u770b\u4e0b\u5b83\u7684\u5b9a\u4e49\uff0c<\/p>\n<h3>First<\/h3>\n<p>\u5373\u5c06\u505a\u52a8\u753b\u7684\u5143\u7d20\u7684\u521d\u59cb\u72b6\u6001\uff08\u6bd4\u5982\u4f4d\u7f6e\u3001\u900f\u660e\u5ea6\u7b49\u7b49\uff09\u3002<\/p>\n<h3>Last<\/h3>\n<p>\u5373\u5c06\u505a\u52a8\u753b\u7684\u5143\u7d20\u7684\u6700\u7ec8\u72b6\u6001\u3002<\/p>\n<h3>Invert<\/h3>\n<p>\u8fd9\u4e00\u6b65\u6bd4\u8f83\u5173\u952e\uff0c\u5047\u8bbe\u6211\u4eec\u56fe\u7247\u7684\u521d\u59cb\u4f4d\u7f6e\u662f <code>\u5de6: 0, \u4e0a\uff1a0<\/code>\uff0c\u5143\u7d20\u52a8\u753b\u540e\u7684\u6700\u7ec8\u4f4d\u7f6e\u662f <code>\u5de6\uff1a100, \u4e0a100<\/code>\uff0c\u90a3\u4e48\u5f88\u660e\u663e\u8fd9\u4e2a\u5143\u7d20\u662f\u5411\u53f3\u4e0b\u89d2\u8fd0\u52a8\u4e86 <code>100px<\/code>\u3002<\/p>\n<p><strong>\u4f46\u662f<\/strong>\uff0c\u6b64\u65f6\u6211\u4eec\u4e0d\u6309\u7167\u5e38\u89c4\u601d\u7ef4\u53bb\u5148\u8ba1\u7b97\u5b83\u7684\u6700\u7ec8\u4f4d\u7f6e\uff0c\u7136\u540e\u518d\u547d\u4ee4\u5143\u7d20\u4ece <code>0, 0<\/code> \u8fd0\u52a8\u5230 <code>100, 100<\/code>\uff0c\u800c\u662f<strong>\u5148\u8ba9\u5143\u7d20\u81ea\u5df1\u79fb\u52a8\u8fc7\u53bb<\/strong>\uff08\u6bd4\u5982\u5728 Vue \u4e2d\u7528\u6570\u636e\u6765\u9a71\u52a8\uff0c\u5728\u6570\u7ec4\u524d\u9762\u8ffd\u52a0\u51e0\u4e2a\u56fe\u7247\uff0c\u4e4b\u524d\u7684\u56fe\u7247\u5c31\u81ea\u5df1\u79fb\u52a8\u5230\u4e0b\u9762\u53bb\u4e86\uff09\u3002<\/p>\n<p>\u8fd9\u91cc\u6709\u4e00\u4e2a\u5173\u952e\u7684\u77e5\u8bc6\u70b9\u8981\u6ce8\u610f\u4e86\uff0c\u4e5f\u662f\u6211\u5728\u4e4b\u524d\u7684\u6587\u7ae0\u300a\u6df1\u5165\u89e3\u6790\u4f60\u4e0d\u77e5\u9053\u7684 EventLoop \u548c\u6d4f\u89c8\u5668\u6e32\u67d3\u3001\u5e27\u52a8\u753b\u3001\u7a7a\u95f2\u56de\u8c03\u300b\u4e2d\u63d0\u5230\u8fc7\u7684\uff1a<\/p>\n<p>DOM \u5143\u7d20\u5c5e\u6027\u7684\u6539\u53d8\uff08\u6bd4\u5982 <code>left<\/code>\u3001<code>right<\/code>\u3001 <code>transform<\/code> \u7b49\u7b49\uff09\uff0c\u4f1a\u88ab\u96c6\u4e2d\u8d77\u6765\u5ef6\u8fdf\u5230\u6d4f\u89c8\u5668\u7684\u4e0b\u4e00\u5e27\u7edf\u4e00\u6e32\u67d3\uff0c\u6240\u4ee5\u6211\u4eec\u53ef\u4ee5\u5f97\u5230\u4e00\u4e2a\u8fd9\u6837\u7684\u65f6\u95f4\u70b9\uff1a<strong>DOM \u72b6\u6001\u6539\u53d8\u4e86\uff0c\u800c\u6d4f\u89c8\u5668\u8fd8\u6ca1\u6e32\u67d3<\/strong>\u3002<\/p>\n<p>\u6709\u4e86\u8fd9\u4e2a\u524d\u7f6e\u6761\u4ef6\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u4fdd\u8bc1\u5148\u8ba9 Vue \u53bb\u64cd\u4f5c DOM \u53d8\u66f4\uff0c\u6b64\u65f6\u6d4f\u89c8\u5668\u8fd8\u672a\u6e32\u67d3\uff0c\u6211\u4eec\u5df2\u7ecf\u80fd\u5f97\u5230 DOM \u72b6\u6001\u53d8\u66f4\u540e\u7684\u4f4d\u7f6e\u4e86\u3002<\/p>\n<p>\u8bf4\u7684\u5177\u4f53\u70b9\uff0c\u5047\u8bbe\u6211\u4eec\u7684\u56fe\u7247\u662f\u4e00\u884c\u4e24\u4e2a\u6392\u5217\uff0c\u56fe\u7247\u6570\u7ec4\u521d\u59cb\u5316\u7684\u72b6\u6001\u662f <code>[img1, img2<\/code>\uff0c\u6b64\u65f6\u6211\u4eec\u5f80\u6570\u7ec4\u5934\u90e8\u8ffd\u52a0\u4e24\u4e2a\u5143\u7d20 <code>[img3, img4, img1, img2]<\/code>\uff0c\u90a3\u4e48 <code>img1<\/code> \u548c <code>img2<\/code> \u5c31\u81ea\u7136\u800c\u7136\u7684\u88ab\u6324\u5230\u4e0b\u4e00\u884c\u53bb\u4e86\u3002<\/p>\n<p>\u5047\u8bbe <code>img1<\/code> \u7684\u521d\u59cb\u4f4d\u7f6e\u662f <code>0, 0<\/code>\uff0c\u88ab\u6570\u636e\u9a71\u52a8\u5bfc\u81f4\u7684 DOM \u6539\u53d8\u6324\u4e0b\u53bb\u540e\u7684\u4f4d\u7f6e\u662f <code>100, 100<\/code>\uff0c\u90a3\u4e48\u6b64\u65f6\u6d4f\u89c8\u5668\u8fd8\u6ca1\u6709\u6e32\u67d3\uff0c\u6211\u4eec\u53ef\u4ee5\u5728\u8fd9\u4e2a\u65f6\u95f4\u70b9\u628a <code>img1.style.transform = translate(-100px, -100px)<\/code>\uff0c\u8ba9\u5b83 \u5148 <strong>Invert<\/strong> \u5012\u7f6e\u56de\u4f4d\u79fb\u524d\u7684\u4f4d\u7f6e\u3002<\/p>\n<h3>Play<\/h3>\n<p>\u5012\u7f6e\u4e86\u4ee5\u540e\uff0c\u60f3\u8981\u8ba9\u5b83\u505a\u52a8\u753b\u5c31\u5f88\u7b80\u5355\u4e86\uff0c\u518d\u8ba9\u5b83\u56de\u5230 <code>0, 0<\/code> \u7684\u4f4d\u7f6e\u5373\u53ef\uff0c\u672c\u6587\u4f1a\u91c7\u7528\u6700\u65b0\u7684 <code>Web Animation API<\/code> \u6765\u5b9e\u73b0\u6700\u540e\u7684 <code>Play<\/code>\u3002<\/p>\n<p>MDN \u6587\u6863\uff1aWeb Animation<\/p>\n<h2>\u5b9e\u73b0<\/h2>\n<p>\u9996\u5148\u56fe\u7247\u6e32\u67d3\u5f88\u7b80\u5355\uff0c\u5c31\u8ba9\u56fe\u7247\u901a\u8fc7 <code>column-count: 4<\/code> \u7b80\u5355\u7684\u6392\u6210 4 \u5217\u5373\u53ef<\/p>\n<pre><code class=\"language-css\" lang=\"css\">.wrap {\r\n  display: flex;\r\n  flex-wrap: wrap;\r\n  column-count: 4;\r\n}\r\n\r\n&lt;div v-else class=\"wrap\"&gt;\r\n  &lt;div class=\"img-wrap\" v-for=\"src in imgs\" :key=\"src\"&gt;\r\n    &lt;img ref=\"imgs\" class=\"img\" :src=\"src\" \/&gt;\r\n  &lt;\/div&gt;\r\n&lt;\/div&gt;\r\n<\/code><\/pre>\n<p>\u90a3\u4e48\u5173\u952e\u70b9\u5c31\u5728\u4e8e\u600e\u4e48\u5f80\u8fd9\u4e2a <code>imgs<\/code> \u6570\u7ec4\u91cc\u8ffd\u52a0\u5143\u7d20\u540e\uff0c\u505a\u4e00\u4e2a\u6d41\u7545\u7684\u8def\u5f84\u52a8\u753b\u3002<\/p>\n<p>\u6211\u4eec\u6765\u5b9e\u73b0\u8ffd\u52a0\u56fe\u7247\u7684\u65b9\u6cd5 <code>add<\/code>\uff1a<\/p>\n<pre><code class=\"language-javascript\" lang=\"javascript\">async add() {\r\n  const newData = this.getSister()\r\n  await preload(newData)\r\n}\r\n<\/code><\/pre>\n<p>\u9996\u5148\u968f\u673a\u7684\u53d6\u51fa\u51e0\u5f20\u56fe\u7247\uff0c\u5229\u7528 <code>new Image<\/code> \u8fdb\u884c\u9884\u52a0\u8f7d\u9632\u6b62\u56fe\u7247\u7a7a\u767d\uff0c\u7136\u540e\u6211\u4eec\u8ba1\u7b97\u5f53\u524d\u65e7\u56fe\u7247\u7684\u4f4d\u7f6e\uff1a<\/p>\n<pre><code class=\"language-javascript\" lang=\"javascript\">function getRects(doms) {\r\n  return doms.map((dom) =&gt; {\r\n    const rect = dom.getBoundingClientRect()\r\n    const { left, top } = rect\r\n    return { left, top }\r\n  })\r\n}\r\n\r\n\/\/ \u5f53\u524d\u5df2\u6709\u7684\u56fe\u7247\r\nconst prevImgs = this.$refs.imgs.slice()\r\nconst prevPositions = getRects(prevImgs)\r\n<\/code><\/pre>\n<p>\u8bb0\u5f55\u5b8c\u56fe\u7247\u7684\u65e7\u4f4d\u7f6e\u540e\uff0c\u5c31\u53ef\u4ee5\u5411\u6570\u7ec4\u91cc\u8ffd\u52a0\u65b0\u7684\u56fe\u7247\u4e86<\/p>\n<pre><code class=\"language-javascript\" lang=\"javascript\">this.imgs = newData.concat(this.imgs)\r\n<\/code><\/pre>\n<p>\u968f\u540e\u5c31\u662f\u6bd4\u8f83\u5173\u952e\u7684\u70b9\u4e86\uff0c\u6211\u4eec\u77e5\u9053 Vue \u662f\u5f02\u6b65\u6e32\u67d3\u7684\uff0c\u4e5f\u5c31\u662f\u6539\u53d8\u4e86\u8fd9\u4e2a <code>imgs<\/code> \u6570\u7ec4\u540e\u4e0d\u4f1a\u7acb\u523b\u53d1\u751f DOM \u7684\u53d8\u52a8\uff0c\u6b64\u65f6\u6211\u4eec\u8981\u7528\u5230 <code>nextTick<\/code> \u8fd9\u4e2a API\uff0c\u8fd9\u4e2a API \u628a\u4f60\u4f20\u5165\u7684\u56de\u8c03\u51fd\u6570\u653e\u8fdb\u4e86 <code>microTask<\/code> \u961f\u5217\uff0c\u6b63\u5982\u4e0a\u6587\u63d0\u5230\u7684\u4e8b\u4ef6\u5faa\u73af\u7684\u6587\u7ae0\u91cc\u6240\u8bf4\uff0c<code>microTask<\/code>\u961f\u5217\u7684\u6267\u884c\u4e00\u5b9a\u53d1\u751f\u5728\u6d4f\u89c8\u5668\u91cd\u65b0\u6e32\u67d3\u524d\u3002<\/p>\n<p>\u7531\u4e8e\u5148\u8c03\u7528\u4e86 <code>this.imgs = newData.concat(this.imgs)<\/code> \u8fd9\u6bb5\u4ee3\u7801\uff0c\u89e6\u53d1\u4e86 Vue \u7684\u54cd\u5e94\u5f0f\u4f9d\u8d56\u66f4\u65b0\uff0c\u6b64\u65f6 Vue \u5185\u90e8\u4f1a\u628a\u672c\u6b21 DOM \u66f4\u65b0\u7684\u6e32\u67d3\u51fd\u6570\u5148\u653e\u5230 <code>microTask<\/code>\u961f\u5217\u4e2d\uff0c\u6b64\u65f6\u7684\u961f\u5217\u662f<code>[changeDOM]<\/code>\u3002<\/p>\n<p>\u8c03\u7528\u4e86 <code>nextTick(callback)<\/code> \u540e\uff0c\u8fd9\u4e2a<code>callback<\/code>\u51fd\u6570\u4e5f\u4f1a\u88ab\u8ffd\u52a0\u5230\u961f\u5217\u4e2d\uff0c\u6b64\u65f6\u7684\u961f\u5217\u662f <code>[changeDOM, callback]<\/code>\u3002<\/p>\n<p>\u8fd9\u4e0b\u806a\u660e\u7684\u4f60\u80af\u5b9a\u5c31\u660e\u767d\u4e86\uff0c\u4e3a\u4ec0\u4e48 <code>nextTick<\/code>\u7684\u56de\u8c03\u51fd\u6570\u91cc\u4e00\u5b9a\u80fd\u83b7\u53d6\u5230\u6700\u65b0\u7684 DOM \u72b6\u6001\u3002<\/p>\n<p>\u7531\u4e8e\u6211\u4eec\u4e4b\u524d\u4fdd\u5b58\u4e86\u56fe\u7247\u5143\u7d20\u8282\u70b9\u7684\u6570\u7ec4 <code>prevImgs<\/code>\uff0c\u6240\u4ee5\u5728 <code>nextTick<\/code> \u91cc\u8c03\u7528\u540c\u6837\u7684 <code>getRect<\/code> \u65b9\u6cd5\u83b7\u53d6\u5230\u7684\u5c31\u662f\u65e7\u56fe\u7247\u7684\u6700\u65b0\u4f4d\u7f6e\u4e86\u3002<\/p>\n<pre><code class=\"language-javascript\" lang=\"javascript\">async add() {\r\n  \/\/ \u6700\u65b0 DOM \u72b6\u6001\r\n  this.$nextTick(() =&gt; {\r\n    \/\/ \u518d\u8c03\u7528\u540c\u6837\u7684\u65b9\u6cd5\u83b7\u53d6\u6700\u65b0\u7684\u5143\u7d20\u4f4d\u7f6e\r\n    const currentPositions = getRects(prevImgs)\r\n},\r\n<\/code><\/pre>\n<p>\u6b64\u65f6\u6211\u4eec\u5df2\u7ecf\u62e5\u6709\u4e86 <code>Invert<\/code> \u6b65\u9aa4\u7684\u5173\u952e\u4fe1\u606f\uff0c\u65b0\u4f4d\u7f6e\u548c\u65e7\u4f4d\u7f6e\uff0c\u90a3\u4e48\u63a5\u4e0b\u6765\u5c31\u5f88\u7b80\u5355\u4e86\uff0c\u628a\u56fe\u7247\u6570\u7ec4\u5faa\u73af\u505a\u4e00\u4e2a\u5012\u7f6e\u540e <code>Play<\/code>\u7684\u52a8\u753b\u5373\u53ef\u3002<\/p>\n<pre><code class=\"language-javascript\" lang=\"javascript\">prevImgs.forEach((imgRef, imgIndex) =&gt; {\r\n  const currentPosition = currentPositions[imgIndex]\r\n  const prevPosition = prevPositions[imgIndex]\r\n\r\n  \/\/ \u5012\u7f6e\u540e\u7684\u4f4d\u7f6e\uff0c\u867d\u7136\u56fe\u7247\u79fb\u52a8\u5230\u6700\u65b0\u4f4d\u7f6e\u4e86\uff0c\u4f46\u4f60\u5148\u7ed9\u6211\u56de\u53bb\uff0c\u7b49\u7740\u6211\u6765\u8ba9\u4f60\u505a\u52a8\u753b\u3002\r\n  const invert = {\r\n    left: prevPosition.left - currentPosition.left,\r\n    top: prevPosition.top - currentPosition.top,\r\n  }\r\n\r\n  const keyframes = [\r\n    \/\/ \u521d\u59cb\u4f4d\u7f6e\u662f\u5012\u7f6e\u540e\u7684\u4f4d\u7f6e\r\n    {\r\n      transform: `translate(${invert.left}px, ${invert.top}px)`,\r\n    },\r\n    \/\/ \u56fe\u7247\u66f4\u65b0\u540e\u672c\u6765\u5e94\u8be5\u5728\u7684\u4f4d\u7f6e\r\n    { transform: \"translate(0)\" },\r\n  ]\r\n\r\n  const options = {\r\n    duration: 300,\r\n    easing: \"cubic-bezier(0,0,0.32,1)\",\r\n  }\r\n\r\n  const animation = imgRef.animate(keyframes, options)\r\n})\r\n<\/code><\/pre>\n<p>\u6b64\u65f6\u4e00\u4e2a\u975e\u5e38\u6d41\u7545\u7684\u8def\u5f84\u52a8\u753b\u6548\u679c\u5c31\u5b8c\u6210\u4e86\u3002<\/p>\n<p>\u5b8c\u6574\u5b9e\u73b0\u5982\u4e0b\uff1a<\/p>\n<pre><code class=\"language-javascript\" lang=\"javascript\">async add() {\r\n  const newData = this.getSister()\r\n  await preload(newData)\r\n\r\n  const prevImgs = this.$refs.imgs.slice()\r\n  const prevPositions = getRects(prevImgs)\r\n\r\n  this.imgs = newData.concat(this.imgs)\r\n\r\n  this.$nextTick(() =&gt; {\r\n    const currentPositions = getRects(prevImgs)\r\n\r\n    prevImgs.forEach((imgRef, imgIndex) =&gt; {\r\n      const currentPosition = currentPositions[imgIndex]\r\n      const prevPosition = prevPositions[imgIndex]\r\n\r\n      const invert = {\r\n        left: prevPosition.left - currentPosition.left,\r\n        top: prevPosition.top - currentPosition.top,\r\n      }\r\n\r\n      const keyframes = [\r\n        {\r\n          transform: `translate(${invert.left}px, ${invert.top}px)`,\r\n        },\r\n        { transform: \"translate(0)\" },\r\n      ]\r\n\r\n      const options = {\r\n        duration: 300,\r\n        easing: \"cubic-bezier(0,0,0.32,1)\",\r\n      }\r\n\r\n      const animation = imgRef.animate(keyframes, options)\r\n    })\r\n  })\r\n},\r\n<\/code><\/pre>\n<h2>\u6e90\u7801\u5730\u5740<\/h2>\n<p><a class=\"url\" href=\"https:\/\/github.com\/sl1673495\/flip-animation\" target=\"_blank\">https:\/\/github.com\/sl1673495\/flip-animation<\/a><\/p>\n<h2>\u603b\u7ed3<\/h2>\n<p>FLIP \u4e0d\u5149\u53ef\u4ee5\u505a\u4f4d\u7f6e\u53d8\u5316\u7684\u52a8\u753b\uff0c\u5bf9\u4e8e\u900f\u660e\u5ea6\u3001\u5bbd\u9ad8\u7b49\u7b49\u4e5f\u4e00\u6837\u53ef\u4ee5\u5f88\u8f7b\u677e\u7684\u5b9e\u73b0\u3002<\/p>\n<p>\u6bd4\u5982\u7535\u5546\u5e73\u53f0\u4e2d\u7ecf\u5e38\u4f1a\u51fa\u73b0\u4e00\u4e2a\u52a8\u753b\uff0c\u70b9\u51fb\u4e00\u5f20\u5546\u54c1\u56fe\u7247\u540e\uff0c\u5546\u54c1\u4ece\u5b83\u672c\u6765\u7684\u4f4d\u7f6e\u6162\u6162\u7684\u653e\u5927\u6210\u4e86\u4e00\u5f20\u5b8c\u6574\u7684\u9875\u9762\u3002<\/p>\n<p><code>FLIP<\/code>\u7684\u601d\u8def\u638c\u63e1\u540e\uff0c\u53ea\u8981\u4f60\u77e5\u9053\u5143\u7d20\u52a8\u753b\u524d\u7684\u72b6\u6001\u548c\u5143\u7d20\u52a8\u753b\u540e\u7684\u72b6\u6001\uff0c\u4f60\u90fd\u53ef\u4ee5\u8f7b\u677e\u7684\u8ba9\u5b83\u4eec\u505a\u4e00\u4e2a\u6d41\u7545\u7684\u52a8\u753b\u540e\u5230\u8fbe\u76ee\u7684\u5730\uff0c\u5e76\u4e14\u6b64\u65f6\u7684 DOM \u72b6\u6001\u662f\u5f88\u5e72\u51c0\u7684\u3002<\/p>\n<p>\u800c\u4e0d\u662f\u901a\u8fc7\u786c\u7f16\u7801\u7684\u5f62\u5f0f\u5f3a\u8feb\u5b83\u4ece <code>0, 0<\/code> \u4f4d\u79fb\u5230 <code>100, 100<\/code>\u3002<\/p>\n<p>\u5e0c\u671b\u8fd9\u7bc7\u6587\u7ae0\u80fd\u8ba9\u5bf9\u52a8\u753b\u53d1\u6101\u7684\u4f60\u6709\u4e00\u4e9b\u6536\u83b7\uff0c\u8c22\u8c22\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u8a00 \u5728 Vue \u7684\u5b98\u7f51\u4e2d\u7684\u8fc7\u6e21\u52a8\u753b\u7ae0\u8282\u4e2d\uff0c\u53ef\u4ee5\u770b\u5230\u4e00\u4e2a\u5f88\u9177\u70ab\u7684\u52a8\u753b\u6548\u679c \u4e4d\u4e00\u770b\uff0c\u8ba9\u6211\u4eec\u624b\u5199\u51fa\u8fd9\u4e2a\u903b\u8f91\u5e94\u8be5\u662f\u975e [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[105,147],"tags":[],"_links":{"self":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/2986"}],"collection":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2986"}],"version-history":[{"count":2,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/2986\/revisions"}],"predecessor-version":[{"id":2990,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/2986\/revisions\/2990"}],"wp:attachment":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2986"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2986"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2986"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}