1、判断el-tab标签的显示和隐藏,
第一次尝试用v-show是不起作用的,v-show的本质作用是display:none,而因为td这类标签是display: table-cell;权限高于display:none,所以v-show失效。
实用性操作:v-if代替v-show。
<el-tab-pane label="Feature" name="third" v-if="isShow">
return: isShow:false,
mounted事件加条件取真:if(this.roleId){this.isShow=true}
2、
尽管不影响代码正常运行,但看到提示红红的文字,忍不住去想解决它。
a.原来的articleList:{}改成articleList:"",即对象变成string类型。虽然没有报错,但是当遇到articleList下面有数组存在也会报错误信息,这时候可以检查子组件: articleList: { type: Object}, 父组件:articleList:{}有没有对应好。
3、
大致翻译:方法没有定义。
解决:data里面定义一个空的初始值就好了,HoldInfo:{}
4、[Vue warn]: Property or method "HandleClose" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property.....
大致翻译:HandleClose这个方法未在实例上定义,但已被引用。
解决:检查看下父组件是否有HandleClose()这个方法,然后子组件弹出层写个方法引用,类似:
Close(){ this.$emit("HandleClose"); }
哪里需要用到,直接调用this.Close()