vue 报错解决:TypeError: Cannot read property '_t' of undefined"
前端报错如下:
[Vue warn]: Error in render: “TypeError: Cannot read property ‘_t’ of undefined”
是在项目中用了多语言配置,vue 跟 i18n之间的兼容问题。解决方法如下:
Vue.use(iView)
替换成
Vue.use(iView, {
i18n: function(path, options) {
let value = i18n.t(path, options)
if (value !== null && value !== undefined) {
return value
}
return ''
}
})
国际化其他配置项不变
vue 报错解决:TypeError: Cannot read property '_t' of undefined"的更多相关文章
- 解决Vue报错:TypeError: Cannot read property 'scrollHeight' of undefined
如图: 解决问题的根源: 这个DOM元素找不到,或者是初始化的时候没有初始化成功,总之就是这个DOM元素并没有创建成功就进行了操作.保证这个DOM元素创建成功了就不会存在这个问题了.判断当前DOM元素 ...
- vue项目使用echarts按需引入实现地图动态显示效果时,报错:TypeError: Cannot read property 'dataToPoint' of undefined
vue项目使用echarts按需引入实现地图动态显示效果时,报错:TypeError: Cannot read property 'dataToPoint' of undefined 借鉴了该大神的文 ...
- Vue 组件封装发布到npm 报错 Uncaught TypeError: Cannot read property 'toLowerCase' of undefined
Uncaught TypeError: Cannot read property 'toLowerCase' of undefined 原因是 没有导出 export default { name:& ...
- js 报错 Uncaught TypeError: Cannot read property 'trim' of undefined
jquery Uncaught TypeError: Cannot read property 'trim' of undefined 报错原因及解决方案 $.trim() 函数用于去除字符串两端的空 ...
- vue报错 Uncaught TypeError: Cannot read property ‘children ’ of null
Uncaught TypeError: Cannot read property ‘children ’ of null ratings未渲染完毕,就跳走goods了,取消默认跳转,即可
- vue报错 Uncaught TypeError: Cannot read property of null
有可能是点击a标签,但是a标签有click事件,未阻止默认事件导致报错,开始都看不出来是什么错误
- easyui Datagrid查询报错Uncaught TypeError:Cannot read property 'length' of undefined
1.问题描述 easyui中datagrid执行loadData方法出现如下异常:Cannot read property 'length' of undefined 2.一开始怀疑是js或者页面的问 ...
- 报错: Uncaught TypeError: Cannot read property 'prototype' of undefined(Day_43)
报错原因 引入的js顺序错误,elementUI需要依赖于Vue,调整顺序即可. 调整后
- Datatable报错Uncaught TypeError: Cannot read property 'cell' of undefined
使用Datatables时,报出错误 仔细想想,是因为我在columns里加入了id,并设置visible:false 但是却没在下面的HTML部分多加一个 th 虽然我觉得因为id是隐藏的,不用加上 ...
- TypeError: Cannot read property '_t' of undefined (VUE + ElementUI + i18n)
在使用vue的ElementUI库,在多语言时报错: TypeError: Cannot read property '_t' of undefined 错误是在点菜单栏时随机抛出的,F12抓不到,只 ...
随机推荐
- pyQT Dialog默认选中某一个选项问题的解决
方法一: 在新建ui文件时不要新建Dialog # -*- coding: utf-8 -*- # Form implementation generated from reading ui file ...
- CSS或HTML如何实现文字下面加点?
就像word里文字加着重号一样,在字的下面加一个点,用CSS怎么做?注意,我说的是下面加点,不是文字加粗或倾斜,请不要回答<strong>或<em>之类的. 把要着重加点的文字 ...
- VS2010-MFC(MFC消息映射机制概述)
转自:http://www.jizhuomi.com/software/147.html 前面已经说过,Windows应用程序是消息驱动的.在MFC软件开发中,界面操作或者线程之间通信都会经常用到消息 ...
- vue中使用watch函数,当数据改变时自动引发事件
本来我的需求是这样的,使用ElementUI的日期选择器,当日期选择器被更改时需要根据新日期来向服务器获取新数据,但是发现这个日期选择器没有change事件,后来终于发现vue有个watch函数就是用 ...
- Python学习day40-并发编程(终)
figure:last-child { margin-bottom: 0.5rem; } #write ol, #write ul { position: relative; } img { max- ...
- 23-css补充
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- Errors were encountered while processing: mysql-server-5.5
ubuntu 中运行完sudo apt-get install curl之后,最后出现: ldconfig deferred processing now taking place Errors we ...
- spfa模版
#include<bits/stdc++.h> using namespace std; int n,m;//点边 int beginn; ],v[],w[]; ],nextt[]; ]; ...
- 【codeforces 508D】Tanya and Password
[题目链接]:http://codeforces.com/problemset/problem/508/D [题意] 给你一个字符的所有连续3个的子串; 让你复原出原串; (包含小写.大写字母以及数字 ...
- js 设置缓存
长期存储 localStorage.getItem("key"); //获取键的值 localStorage.setItem("key" ...