久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <i id='guUuD'><tr id='guUuD'><dt id='guUuD'><q id='guUuD'><span id='guUuD'><b id='guUuD'><form id='guUuD'><ins id='guUuD'></ins><ul id='guUuD'></ul><sub id='guUuD'></sub></form><legend id='guUuD'></legend><bdo id='guUuD'><pre id='guUuD'><center id='guUuD'></center></pre></bdo></b><th id='guUuD'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='guUuD'><tfoot id='guUuD'></tfoot><dl id='guUuD'><fieldset id='guUuD'></fieldset></dl></div>
  • <legend id='guUuD'><style id='guUuD'><dir id='guUuD'><q id='guUuD'></q></dir></style></legend>

        <bdo id='guUuD'></bdo><ul id='guUuD'></ul>

      <small id='guUuD'></small><noframes id='guUuD'>

      1. <tfoot id='guUuD'></tfoot>

        Object.assign 不是函數

        Object.assign is not a function(Object.assign 不是函數)
      2. <tfoot id='j7yJC'></tfoot>

          <legend id='j7yJC'><style id='j7yJC'><dir id='j7yJC'><q id='j7yJC'></q></dir></style></legend>
            <tbody id='j7yJC'></tbody>
          • <small id='j7yJC'></small><noframes id='j7yJC'>

              <bdo id='j7yJC'></bdo><ul id='j7yJC'></ul>

                <i id='j7yJC'><tr id='j7yJC'><dt id='j7yJC'><q id='j7yJC'><span id='j7yJC'><b id='j7yJC'><form id='j7yJC'><ins id='j7yJC'></ins><ul id='j7yJC'></ul><sub id='j7yJC'></sub></form><legend id='j7yJC'></legend><bdo id='j7yJC'><pre id='j7yJC'><center id='j7yJC'></center></pre></bdo></b><th id='j7yJC'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='j7yJC'><tfoot id='j7yJC'></tfoot><dl id='j7yJC'><fieldset id='j7yJC'></fieldset></dl></div>
                1. 本文介紹了Object.assign 不是函數的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我正在使用 babel 和 gulp 并在 ES6 中創建一個簡單的 DOM 庫.但是在運行之后,當我要使用它時,我在 chrome 控制臺中得到了 Object.assign is not a function .

                  I'm using babel with gulp and create a simple DOM library in ES6. But after running and when i'm going to use it, I got the Object.assign is not a function in chrome console.

                  這是 gulp 代碼

                  gulp.task('scripts', function() {
                      return gulp.src(src + 'js/*.js')
                        .pipe(babel())
                        .pipe(concat('main.js'))
                        .pipe(gulp.dest(dest + 'js'));
                  });
                  

                  這是類文件

                  class DOM {
                      constructor( selector ) {
                          var elements = document.querySelectorAll(selector);
                  
                          this.length = elements.length;
                  
                          Object.assign(this, elements);
                      }
                  
                      ...
                  
                  }
                  
                  const dom = selector => new DOM(selector);
                  

                  我在客戶端使用它,例如 dom('#elId');

                  and I'm using it in client side like dom('#elId');

                  推薦答案

                  我懷疑你已經知道,谷歌瀏覽器使用 V8,支持 ECMAScript 第 5 版.Object.assign 在 ECMAScript 第 6 版中引入.

                  As I suspect you already know, Google Chrome uses V8, which supports ECMAScript 5th edition. Object.assign is introduced in ECMAScript 6th edition.

                  為了使用這些添加,你需要包含 Babel 提供的 ES6 polyfill:

                  In order to use these additions, you need to include the ES6 polyfill provided by Babel:

                  這將模擬一個完整的 ES6 環境.[...]

                  This will emulate a full ES6 environment. [...]

                  可從 babel-core npm 版本中的 browser-polyfill.js 文件獲得.這需要包含在所有編譯的 Babel 代碼之前.您可以將其添加到已編譯的代碼中,也可以將其包含在 <script> 之前.

                  Available from the browser-polyfill.js file within a babel-core npm release. This needs to be included before all your compiled Babel code. You can either prepend it to your compiled code or include it in a <script> before it.

                  這篇關于Object.assign 不是函數的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Browserify, Babel 6, Gulp - Unexpected token on spread operator(Browserify,Babel 6,Gulp - 傳播運算符上的意外令牌)
                  Is it possible to pass a flag to Gulp to have it run tasks in different ways?(是否可以將標志傳遞給 Gulp 以使其以不同的方式運行任務?)
                  Why do we need to install gulp globally and locally?(為什么我們需要在全局和本地安裝 gulp?)
                  How to run Gulp tasks sequentially one after the other(如何一個接一個地依次運行 Gulp 任務)
                  Stylesheet not loaded because of MIME-type(由于 MIME 類型而未加載樣式表)
                  Visual Studio 2015 crashes when opening Javascript files(打開 Javascript 文件時 Visual Studio 2015 崩潰)

                    <legend id='yKTfl'><style id='yKTfl'><dir id='yKTfl'><q id='yKTfl'></q></dir></style></legend>
                      <tbody id='yKTfl'></tbody>
                    • <i id='yKTfl'><tr id='yKTfl'><dt id='yKTfl'><q id='yKTfl'><span id='yKTfl'><b id='yKTfl'><form id='yKTfl'><ins id='yKTfl'></ins><ul id='yKTfl'></ul><sub id='yKTfl'></sub></form><legend id='yKTfl'></legend><bdo id='yKTfl'><pre id='yKTfl'><center id='yKTfl'></center></pre></bdo></b><th id='yKTfl'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='yKTfl'><tfoot id='yKTfl'></tfoot><dl id='yKTfl'><fieldset id='yKTfl'></fieldset></dl></div>
                    • <small id='yKTfl'></small><noframes id='yKTfl'>

                        <tfoot id='yKTfl'></tfoot>

                            <bdo id='yKTfl'></bdo><ul id='yKTfl'></ul>
                          • 主站蜘蛛池模板: 一级高清 | 国产色婷婷精品综合在线播放 | 91视视频在线观看入口直接观看 | 亚洲第1页 | 免费一区| 欧美精品一区二区三区在线播放 | 亚洲激情在线观看 | 色视频在线观看 | 国产精品久久久亚洲 | av网站免费在线观看 | 一区二区三区四区免费在线观看 | 中文成人在线 | 国产精品呻吟久久av凹凸 | 欧美一区二区三区视频在线 | 欧美日韩高清一区二区三区 | 伊人影院99 | 欧洲一区二区视频 | 日本精品一区二区 | 日韩欧美一区二区三区四区 | 欧美视频 | 国产精品我不卡 | 狠狠久| 日韩一区二区三区精品 | 男人av的天堂 | 中文在线a在线 | 亚洲一区二区三区四区五区中文 | 亚洲成人福利在线观看 | 精品久久久久久久久久 | 国产一区二区精品在线 | 99视频在线播放 | 日韩精品一区二区在线 | 亚洲国产成人精品久久 | 久久久久久亚洲欧洲 | 黄视频网站在线 | 亚洲成人福利视频 | 香蕉久久久 | www.亚洲视频.com | 欧美aaaa视频 | 久久久久久九九九九九九 | 桃花av在线 | 国产精品久久久久久久久免费樱桃 |