vue
watch: {
'formInline.ruleDeptName' (val){
console.log("申请单位 "+JSON.stringify(val))
}
}
beforeRouteLeave (to, from, next) {
debugger
this.echartVisible = false
console.log(to)
console.log(from)
next()//一定不要忘记写
},
var currentProfileIndex = (profiles|| []).findIndex((profile) => profile.id === currentProfile .id);
var s = "abc,abcd,aaa";
ss = s.split(",");// 在每个逗号(,)处进行分解。
var s = "abc,abcd,aaa";
ss = s.split(",").map(Number)
this.$set(this.formInline,'cz',this.formInline.cz.split(","))
yyyy-MM-dd HH:mm:ss
new Date().getTime()
数组操作
this.editableTabs.push({
title: 'New Tab',
name: newTabName,
content: 'New Tab content'
});
this.dataList.forEach((item, index) => {
var tbCol = {}
tbCol.fieldCnName = item.fieldCnName
})
let array = Array.from(new Set(list))
let parA = this.tableData.fieldData[i].parA;
this.$delete(this.tableData.fieldData[i],'parA');
this.$delete(param,'defaultExtraVal');
this.$set(this.params,i,param)
var fruits = ["Banana", "Orange", "Apple", "Mango"];
var a = fruits.indexOf("Apple"); // 2
let mainTab = this.mainTabs.filter(item => item.name.toString() == tab.name)[0]
判空
//字符串对象
export function stringIsEmpty(parA){
//为空返回true
if(parA == null || typeof (parA) == "undefined" || parA == "" ){
return true
}else{
if(isString(parA)){
if(parA.trim() == ""){
return true
}
}
return false
}
}
//判断是否为原始类型:字符串、数字或者布尔类型,
export function isString(obj){
return typeof(obj) === 'string'?true:false;
}
//数组对象
export function arrIsEmpty(arr){
//为空返回true
if(arr == null ||arr == undefined || arr.length <= 0){
return true
}
return false
}
//对象为空
export function isEmptyObject(obj){
if(JSON.stringify(obj)=='{}' || obj == null){
return true
}
return false
}