V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
pcxys
V2EX  ›  前端开发

Vue-cli 载入 bootstrap 报错

  •  
  •   pcxys · 2022-05-06 22:03:41 +08:00 · 964 次点击
    这是一个创建于 930 天前的主题,其中的信息可能已经有所发展或是发生改变。

    jquery 已确认可用,

    main.js 已导入

    import ‘bootstrap/dist/css/bootstrap.min.css’,

    import ‘bootstrap/dist/js/bootstrap.min’

    保存,启动,载入 bootstrap 出现错误,求助。

    ERROR Failed to compile with 1 errors 23:18:34

    error in e:/github/project-manage-java/node_modules/_[email protected].3@bootstrap/dist/js/bootstrap.min.js

    Module parse failed: Unexpected token (6:12045) You may need an appropriate loader to handle this file type. | * Licensed under MIT ( https://github.com/twbs/bootstrap/blob/main/LICENSE) | */ | !function(t,e){“object”==typeof exports&&“undefined”!=typeof module?module.exports=e(require("@popperjs/core")):“function”==typeof define&&define.amd?define(["@popperjs/core"],e):(t=“undefined”!=typeof globalThis?globalThis:t||self).bootstrap=e(t.Popper)}(this,(function(t){“use strict”;function e(t){if(t&&t.__esModule)return t;const e=Object.create(null);if(t)for(const i in t)if(“default”!==i){const s=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>t[i]})}return e.default=t,Object.freeze(e)}const i=e(t),s=“transitionend”,n=t=>{let e=t.getAttribute(“data-bs-target”);if(!e||"#"===e){let i=t.getAttribute(“href”);if(!i||!i.includes("#")&&!i.startsWith("."))return null;i.includes("#")&&!i.startsWith("#")&&(i=#${i.split("#")[1]}),e=i&&"#"!==i?i.trim():null}return e},o=t=> …………已省略部分内容……………… {this._element.classList.remove(oi),$.trigger(this._element,“shown.bs.toast”),this._maybeScheduleHide()}),this._element,this._config.animation))}hide(){this._element.classList.contains(ni)&&($.trigger(this._element,“hide.bs.toast”).defaultPrevented||(this._element.classList.add(oi),this._queueCallback((()=>{this._element.classList.add(si),this._element.classList.remove(oi),this._element.classList.remove(ni),$.trigger(this._element,“hidden.bs.toast”)}),this._element,this._config.animation)))}dispose(){this._clearTimeout(),this._element.classList.contains(ni)&&this._element.classList.remove(ni),super.dispose()}_getConfig(t){return t={…ai,…X.getDataAttributes(this._element),…“object”==typeof t&&t?t:{}},h(ii,t,this.constructor.DefaultType),t}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout((()=>{this.hide()}),this._config.delay)))}_onInteraction(t,e){switch(t.type){case"mouseover":case"mouseout":this._hasMouseInteraction=e;break;case"focusin":case"focusout":this._hasKeyboardInteraction=e}if(e)return void this._clearTimeout();const i=t.relatedTarget;this._element===i||this._element.contains(i)||this._maybeScheduleHide()}_setListeners(){$.on(this._element,“mouseover.bs.toast”,(t=>this._onInteraction(t,!0))),$.on(this._element,“mouseout.bs.toast”,(t=>this._onInteraction(t,!1))),$.on(this._element,“focusin.bs.toast”,(t=>this._onInteraction(t,!0))),$.on(this._element,“focusout.bs.toast”,(t=>this._onInteraction(t,!1)))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(t){return this.each((function(){const e=li.getOrCreateInstance(this,t);if(“string”==typeof t){if(void 0===e[t])throw new TypeError(No method named "${t}");et}}))}}return F(li),v(li),{Alert:q,Button:U,Carousel:at,Collapse:mt,Dropdown:Ht,Modal:he,Offcanvas:me,Popover:Fe,ScrollSpy:Ye,Tab:ei,Toast:li,Tooltip:$e}})); | //# sourceMappingURL=bootstrap.min.js.map

    @ ./src/main.js 8:0-44 @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/main.js

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1550 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 17:07 · PVG 01:07 · LAX 09:07 · JFK 12:07
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.