ElementUI this.$message is not a function 解决方法

简介: ElementUI this.$message is not a function 解决方法

         许多小伙伴可能会碰到该错误,如果你已经引入了Vue的包,和ElementUI的包,即

<script src="https://unpkg.com/vue/dist/vue.js"></script>
<script src="https://unpkg.com/element-ui/lib/index.js"></script>

image.gif

可以直接这样使用

Vue.prototype.$message({
     message: '无法搜索到相关书籍,请更换关键词并重新查询',
     type: 'error'
 });

image.gif

成功图片

image.gif编辑

目录
相关文章
|
5天前
|
弹性计算 缓存 Serverless
Serverless 应用引擎操作报错合集之阿里函数计算中我打开sd时遇到错误,信息为"Function instance exited unexpectedly(code 1, message:operation not permitted) with start command ' '."如何解决
Serverless 应用引擎(SAE)是阿里云提供的Serverless PaaS平台,支持Spring Cloud、Dubbo、HSF等主流微服务框架,简化应用的部署、运维和弹性伸缩。在使用SAE过程中,可能会遇到各种操作报错。以下是一些常见的报错情况及其可能的原因和解决方法。
17 6
|
10月前
|
JavaScript
vue项目使用elementui上传组件 打包后报错t.upload.addEventListener is not a function的解决方案
今天和大家分享一个报错的解决方案 背景 项目打包部署到宝塔上后,打开网页,上传东西时出现了一个报错,但是在本地开发环境是没有问题的。
vue项目使用elementui上传组件 打包后报错t.upload.addEventListener is not a function的解决方案
|
5天前
|
Java 中间件 Serverless
Serverless 应用引擎操作报错合集之在阿里函数计算中,云函数怎么一直报错Function instance exited unexpectedly(code 1, message:operation not permitted) with start command 'php server.php '.如何解决
Serverless 应用引擎(SAE)是阿里云提供的Serverless PaaS平台,支持Spring Cloud、Dubbo、HSF等主流微服务框架,简化应用的部署、运维和弹性伸缩。在使用SAE过程中,可能会遇到各种操作报错。以下是一些常见的报错情况及其可能的原因和解决方法。
14 2
|
5天前
|
弹性计算 Dubbo Serverless
Serverless 应用引擎操作报错合集之阿里函数计算中配置完fc,出现‘Function instance exited unexpectedly(code 1, message:operation not permitted) with start command 'npm run start '. 报错如何解决
Serverless 应用引擎(SAE)是阿里云提供的Serverless PaaS平台,支持Spring Cloud、Dubbo、HSF等主流微服务框架,简化应用的部署、运维和弹性伸缩。在使用SAE过程中,可能会遇到各种操作报错。以下是一些常见的报错情况及其可能的原因和解决方法。
14 5
|
7月前
|
人工智能 自然语言处理 小程序
cloud function service error code -501000, error message 找不到对应的FunctionName.; at cloud.callFunction
cloud function service error code -501000, error message 找不到对应的FunctionName.; at cloud.callFunction
45 0
|
10月前
|
JavaScript
vue项目使用elementui上传组件 打包后报错t.upload.addEventListener is not a function的解决方案
vue项目使用elementui上传组件 打包后报错t.upload.addEventListener is not a function的解决方案
225 0
|
JavaScript
Vue:Uncaught TypeError Object(...) is not a function at resetStoreState (vuex.esm-browser.js55021
Vue:Uncaught TypeError Object(...) is not a function at resetStoreState (vuex.esm-browser.js55021
434 0
Vue:Uncaught TypeError Object(...) is not a function at resetStoreState (vuex.esm-browser.js55021
|
存储 缓存 小程序
小程序的thirdScriptError ..... is not a function 报错的解决方法
小程序的thirdScriptError ..... is not a function 报错的解决方法
429 0

热门文章

最新文章