最后
由于文档内容过多,为了避免影响到大家的阅读体验,在此只以截图展示部分内容
isCheck: {
type: Boolean,
default: false
},
isErr: {
type: Boolean,
default: false
},
value: {
type: [String, Number],
default: “”
},
disabled: {
type: Boolean,
default: false
},
popoverText: {
type: String,
default: “”
},
gitInputBlur: {
type: String,
default: “”
},
serviceVal: {
type: [String, Number],
default: “”
},
serviceSwitch: {
// 是否开启服务访问
type: Boolean,
default: false
},
serviceWarning: {
// 提示消息
type: String,
default: “”
},
modify: {
// 修改页面才弹确认框
type: Boolean,
default: false
}
},
watch: {
serviceSwitch: {
handler(val) {
this.needCheck = val;
},
deep: true
}
},
created() {
this.val = this.serviceVal;
this.needCheck = this.serviceSwitch;
},
data() {
return {
error: true, //验证是否通过 默认验证通过
reg: /(^ +| +$)/gi, //校验为空
val: this.value, //输入的数据
is_err: this.isErr,
needCheck: false,
oldInputVal: “”
};
},
methods: {
//获取焦点事件
inputFocus() {
this.is_err = false;
this.oldInputVal = this.val;
},
//失去焦点事件
inputBlur() {
let isCheck = this.isCheck;
let val = “”;
if (this.val && typeof this.val == “string”) {
val = this.val.replace(this.reg, “”);
}
this.val = val;
if (isCheck) {
if (val == “”) {
this.is_err = true;
}
} else {
this.is_err = false;
}
let reg = /1{1,}$/;
if (!reg.test(this.val)) {
this.$message.error({
message: “服务名只支持字母数字中划线~”,
duration: 3000
});
this.is_err = true;
} else {
if (this.needCheck && this.modify) {
this. c o n f i r m ( ‘ confirm(` confirm(‘{this.serviceWarning}`, “提示”, {
confirmButtonText: “确定”,
cancelButtonText: “取消”,
type: “warning”
})
.then(() => {
this.$message({
type: “success”,
message: “修改成功!”
});
})
.catch(() => {
this.val = this.oldInputVal;
this.$message({
type: “info”,
message: “已取消修改”
});
});
}
this.getInputVal(this.val);
}
}
}
};
父组件
最后前端到底应该怎么学才好?
如果你打算靠自己摸索自学,那么你首先要了解学习前端的基本大纲,这是你将要学习的主要内容,理解以及掌握好这些内容,便可以找到一份初级的前端开发工作。你还需要有一套完整的前端学习教程,作为初学者最好的方式就是看视频教程学习,初学者容易理解接受。
不要选择买书学习,这样的方式没有几个人能学会,基本都是看不下去书,也看不懂书。如果喜欢看书的学弟,可以买一些经典的书籍作为辅助即可,主要还是以看教程为主。每天抽出固定几个小时学习,做好长期学习的准备。学习编程并不是每天光看视频,你学习编程最重要的目的是为了编写软件产品,提供给大众使用,所以用手写出代码实现功能才是我们要做的事情。
开源分享:【大厂前端面试题解析+核心总结学习笔记+真实项目实战+最新讲解视频】
naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3h6aXQ0OTQ4MDE4MzE=,size_16,color_FFFFFF,t_70#pic_center)
0-9a-zA-Z- ↩︎