久久久久久久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>
                          • 主站蜘蛛池模板: 国产精品中文在线 | 日本一区二区三区在线观看 | 一级a性色生活片久久毛片波多野 | 亚洲综合色网站 | 国产精品久久久久久久久污网站 | 欧区一欧区二欧区三免费 | 亚洲久久 | 精品综合久久久 | 亚洲色欲色欲www | 9999视频 | 国产午夜在线观看 | 亚洲三级在线观看 | 综合二区 | 91国产精品在线 | 成人在线免费 | 99国产精品一区二区三区 | 日韩精品视频在线免费观看 | 国产福利91精品一区二区三区 | 国产粉嫩尤物极品99综合精品 | 亚洲成人午夜电影 | 精品视频免费 | 久久综合av | 亚洲精品成人av | av毛片在线免费观看 | 精品国产一区二区三区日日嗨 | 欧美一级视频免费看 | 香蕉大人久久国产成人av | 国产一区欧美 | 色免费在线视频 | 91大神在线资源观看无广告 | 精品国产乱码久久久久久蜜臀 | 一区二区三区四区在线视频 | 免费观看成人鲁鲁鲁鲁鲁视频 | 久久久久免费观看 | 韩日一区二区三区 | 色综合久久天天综合网 | 久久福利电影 | 中文字幕 亚洲一区 | 精品视频在线免费观看 | 99这里只有精品视频 | 国产视频一区二区三区四区五区 |