02 2022 档案

摘要:代码: <script> //数组遍历 let arr = ["a", "b", "c"]; arr[3] = "d"; for (let item in arr) { console.log(item); } //结果 0 1 2 3 for (let item of arr) { console 阅读全文
posted @ 2022-02-24 20:50 lijun12138 阅读(178) 评论(0) 推荐(0) 编辑
摘要:实现此类效果:(flex) 代码: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name= 阅读全文
posted @ 2022-02-24 00:57 lijun12138 阅读(52) 评论(0) 推荐(0) 编辑
摘要:1.在route文件夹下面新增路由模块,如login.router.js 确保Login.vue这个组件存在 2在router下的主文件index.js中新增 //路由接收数组 const routerList = []; //获取所有路由文件 function importRouterAll(r) 阅读全文
posted @ 2022-02-14 00:11 lijun12138 阅读(35) 评论(0) 推荐(0) 编辑
摘要:1注册全局指令 // 注册一个全局自定义指令 `v-focus` Vue.directive('focus', { // 当被绑定的元素插入到 DOM 中时…… inserted: function (el) { // 聚焦元素 el.focus() } }) 2注册局部指令 directives: 阅读全文
posted @ 2022-02-13 22:59 lijun12138 阅读(34) 评论(0) 推荐(0) 编辑
摘要:vue中除了有template模板渲染还有render函数渲染,其实template中也是用的render函数渲染 render函数简单使用实例 1定义一个button.vue文件: <script> export default { props: { type: { type: String, d 阅读全文
posted @ 2022-02-13 21:38 lijun12138 阅读(226) 评论(0) 推荐(0) 编辑
摘要:报错: 其实都不是错误,只是ESlint语法规则问题 去除ESlint校验, 在vue.config.js文件中加入 就可以了 阅读全文
posted @ 2022-02-13 21:24 lijun12138 阅读(177) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示