2024年最新vue + element-ui + 阿里云oss服务端签名后直传实践,2024年最新Web前端面试必刷的200道真题

数据结构与算法

这一块在笔试、面试的代码题中考核较多,其中常考的数据结构主要有:数组、链表、队列、栈、Set、Map、哈希表等,不同数据结构有不同的方法以及储存原理,这些算是技术岗的必备知识。算法部分主要分为两大块,排序算法与一些其他算法题

开源分享:【大厂前端面试题解析+核心总结学习笔记+真实项目实战+最新讲解视频】

排序算法根据考频高低主要有:快速排序、归并排序、堆排序、冒泡排序、插入排序、选择排序、希尔排序、桶排序、基数排序、Timsort这十种,这类考核点要么是算法的时间、空间复杂度、稳定度,要么是直接手写代码,故在理解算法原理的同时,对JS语言版的排序算法代码也要加强记忆。

  • 二叉树层序遍历
  • B 树的特性,B 树和 B+树的区别
  • 尾递归
  • 如何写一个大数阶乘?递归的方法会出现什么问题?
  • 把多维数组变成一维数组的方法
  • 知道的排序算法 说一下冒泡快排的原理
  • Heap 排序方法的原理?复杂度?
  • 几种常见的排序算法,手写
  • 数组的去重,尽可能写出多个方法
  • 如果有一个大的数组,都是整型,怎么找出最大的前 10 个数
  • 知道数据结构里面的常见的数据结构
  • 找出数组中第 k 大的数组出现多少次,比如数组【1,2, 4,4,3,5】第二大的数字是 4,出现两次,所以返回 2
  • 合并两个有序数组
  • 给一个数,去一个已经排好序的数组中寻找这个数的位 置(通过快速查找,二分查找)

imageUrl() {

return this.value

},

imageName() {

if (this.value != null && this.value !== ‘’) {

return this.value.substr(this.value.lastIndexOf(‘/’) + 1)

} else {

return null

}

},

fileList() {

return [{

name: this.imageName,

url: this.imageUrl

}]

},

showFileList: {

get: function() {

return this.value !== null && this.value !== ‘’ && this.value !== undefined

},

set: function(newValue) {

}

}

},

methods: {

emitInput(val) {

this.$emit(‘input’, val)

},

handleRemove(file, fileList) {

this.emitInput(‘’)

},

handlePreview(file) {

this.dialogVisible = true

},

getUUID() {

return ‘xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx’.replace(/[xy]/g, c => {

return (c === ‘x’ ? (Math.random() * 16 | 0) : (‘r&0x3’ | ‘0x8’)).toString(16)

})

},

beforeUpload(file) {

const _self = this

return new Promise((resolve, reject) => {

// 前后端提交post异步请求获取签名信息

this.postRequest(‘/oss/policy’)

.then((response) => {

_self.dataObj.policy = response.policy

_self.dataObj.signature = response.signature

_self.dataObj.ossaccessKeyId = response.accessid

self.dataObj.key = response.dir + this.getUUID() + '${filename}’

_self.dataObj.dir = response.dir

_self.dataObj.host = response.host

resolve(true)

}).catch(err => {

reject(false)

})

})

},

handleUploadSuccess(res, file) {

console.log(‘上传成功…’)

this.showFileList = true

this.fileList.pop()

this.fileList.push({ name: file.name, url: this.dataObj.host + ‘/’ + this.dataObj.key.replace(‘${filename}’, file.name) })

this.emitInput(this.fileList[0].url)

}

}

}

引用上传子组件的页面的示例代码:

  • 22
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值