vue-cli-plugin-element-plus
vue-cli-plugin-element-plus copied to clipboard
Element Plus plugin for @vue/cli 4.5
First installation, following https://element-plus.org/#/en-US/component/quickstart went like this: ``` vue add element-plus ✔ 16:13:36 📦 Installing vue-cli-plugin-element-plus... added 1 package in 5s ✔ Successfully installed plugin: vue-cli-plugin-element-plus ?...
版本:vue cli4.5.15、 vue3 参照说明vue add element-plus 添加了国际化选项后运行报错,报错内容如下  
use vue-cli (version @vue/cli 4.5.12) select create by typescript,vue 3.0,router,store,css-process,and jest. input vue add element-plus,when install success,webpack complied fail with some log show 'Could not find a declaration file for...
ERROR TypeError: Cannot read property 'replace' of undefined TypeError: Cannot read property 'replace' of undefined at D:\testProject\element-demo\node_modules\vue-cli-plugin-element-plus\generator\index.js:45:45 at runGenerator (C:\Users\xxx\AppData\Roaming\npm\node_modules\@vue\cli\lib\invoke.js:132:13) at processTicksAndRejections (internal/process/task_queues.js:95:5) at async invoke (C:\Users\xxx\AppData\Roaming\npm\node_modules\@vue\cli\lib\invoke.js:92:3) **Window 10 platform...
i tried ``` this.$notify.success({ title: "transaction successed", message: 'success', duration: 3000, }) ``` and ``` this.$notify({ title: "transaction successed", message: 'success', type: 'success', //or 'info' or 'warning' duration: 3000, });...
不知道是不是官方小伙独爱单引号, 麻烦修改一下正则吧 ```javascript // ./node_modules/vue-cli-plugin-element-plus/generator/index.js:45:45 bug fix // edit line 41 // error code const renderIndex = lines.findIndex(line => line.match(/createApp\(App\)(\.use\(\w*\))*\.mount\('#app'\)/)) // fix code const renderIndex = lines.findIndex(line => line.match(/createApp\(App\)(\.use\(\w*\))*\.mount\(['"]#app['"]\)/)) ```
fixes #21
Due to [an i18n breaking change](https://element-plus.gitee.io/#/en-US/component/i18n) in 1.0.2-beta.59, the current generated setup would throw: ``` These dependencies were not found: * element-plus/lib/theme-chalk/use-locale-props.css in ./src/main.js * element-plus/lib/theme-chalk/use-locale.css in ./src/main.js * element-plus/lib/use-locale...
``` powershell PS D:\Temp\VSCode\0-dimension-dictionary> vue add element-plus WARN There are uncommitted changes in the current repository, it's recommended to commit or stash them first. ? Still proceed? Yes 📦 Installing...