malekim / v3confirm

A plugin dedicated for vue3 to show confirm dialog modal
https://malekim.github.io/v3confirm/
MIT License
4 stars 4 forks source link

Vue CLI project fails to compile after installation #6

Open thecyrilcril opened 2 years ago

thecyrilcril commented 2 years ago

on running npm run serve I get:

 error  in ./node_modules/v3confirm/dist/index.js

Module parse failed: Unexpected token (1:990)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var vue=require("vue");const renderConfirm=o=>vue.defineComponent({props:{text:{type:String,required:!0},yesText:{type:String,required:!0},noText:{type:String,required:!0}},setup(){const e=vue.ref(!0);const t=()=>{e.value=!1};return{isActive:e,confirm:()=>{t(),o(!0)},discard:()=>{t(),o(!1)},close:t}},render(){return this.isActive?vue.h("div",{class:"modal is-active"},[vue.h("div",{class:"modal-background",onClick:()=>this.close()}),vue.h("div",{class:"modal-content"},[vue.h("div",{class:"modal-card modal-confirm"},[vue.h("header",{class:"modal-card-head"},this.text),vue.h("footer",{class:"modal-card-foot"},[vue.h("button",{class:"button",onClick:()=>this.confirm()},this.yesText),vue.h("button",{class:"button",onClick:()=>this.discard()},this.noText)])])]),vue.h("button",{class:"modal-close is-medium","aria-label":"close",onClick:()=>this.close()})]):null}}),confirmKey="confirm",plugin=n=>({show:r=>{const i=n?.root?n.root:"#app";return new Promise(e=>{const t=n?.yesText?n.yesText:"Yes",o=n?.noText?n.noText:"No",s=renderConfirm(e);vue.nextTick(()=>vue.createApp(s,{text:r,yesText:t,noText:o}).mount(i))})}}),VueConfirmPlugin=(e,t)=>{t=plugin(t);e.provide(confirmKey,t)},useConfirm=(e="")=>vue.inject(""!==e?e:confirmKey);exports.default=VueConfirmPlugin,exports.useConfirm=useConfirm;
| //# sourceMappingURL=index.js.map
|

 @ ./src/main.js 6:0-41
 @ multi (webpack)-dev-server/client?http://etradexchange.test:8080&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.js
malekim commented 2 years ago

What is your webpack configuration?

thecyrilcril commented 2 years ago

What is your webpack configuration?

I am not doing anything special. its just a vue-cli project....I will create a fresh one and revert