web前端面试题
1宽高固定的一个div水平垂直固定有几种方法1. 绝对定位 负 margin传统方法 .child{position:absolute;left:50%;top:50%;margin-left:-100px;/* 宽度的一半 */margin-top:-50px;/* 高度的一半 */width:200px;height:100px;}2. 绝对定位 transform无需手动计算 .child{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:200px;height:100px;}3. 绝对定位 margin: auto经典四零定位 .child{position:absolute;left:0;right:0;top:0;bottom:0;margin:auto;width:200px;height:100px;}4Flexbox .parent{display:flex;justify-content:center;align-items:center;}.child{width:200px;height:100px;}5. Grid 布局 .parent{display:grid;place-items:center;/* 同时设置 align-items 和 justify-items */}.child{width:200px;height:100px;}6. 利用表格布局display: table-cell .parent{display:table-cell;vertical-align:middle;text-align:center;width:500px;height:500px;}.child{display:inline-block;/* 或 inline */width:200px;height:100px;text-align:left;/* 恢复内部文字对齐 */}2position的属性有哪些区别是什么3margin 负值。在什么地方用3vue2set什么时候需要用为什么会有set 什么时候需要用为什么会有set什么时候需要用为什么会有set,vue3还需不需要45vue $nextTick什么时候用在数据变化后执行的某个操作而这个操作需要使用随数据变化而变化的DOM结构的时候这个操作就需要方法在nextTick()的回调函数中。 在vue生命周期中如果在created()钩子进行DOM操作也一定要放在nextTick()的回调函数中。flex为1的时候子元素限制一行时内容撑出父元素布局解决方案移动端上部分固定下部分滚动怎么设置图表大屏怎么兼容不同分辨率的问题pc端截图功能怎么实现的使用过程中有没有遇到什么问题微信小程序怎么实现无感刷新token或者接口401时怎么实现刷新tokenvue 组件通信vue 从A路由跳转到B路由路由守卫的执行顺序1. PageA 组件内守卫 beforeRouteLeave 2. 全局前置守卫 beforeEach 3. 路由独享守卫 beforeEnter 4. PageB 组件内守卫 beforeRouteEnter 5. 全局解析守卫 beforeResolve 6. 全局后置钩子 afterEach 7. PageB beforeRouteEnter 回调 (组件已创建可访问 this)高德地图开发的时候有遇到过什么问题吗有什么优化地图卡顿的解决办法