欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

uniapp 拖拽圖片排序功能實(shí)現(xiàn) 類(lèi)似于微信朋友圈效果

 更新時(shí)間:2024年07月19日 10:08:39   作者:星 辰.  
這篇文章主要介紹了uniapp 拖拽圖片排序功能實(shí)現(xiàn)類(lèi)似于微信朋友圈,一部分是拖拽的放大做小,xy位置判定,圖片數(shù)組的插入排序,另一部分是上傳加號(hào)圖片的?定位? 動(dòng)態(tài)計(jì)算分為幾列,每一個(gè)圖片大小的位置?絕對(duì)定位的計(jì)算,需要的朋友可以參考下

1、效果展示

2、一部分是拖拽的放大做小,xy位置判定,圖片數(shù)組的插入排序,另一部分是上傳加號(hào)圖片的 定位  動(dòng)態(tài)計(jì)算分為幾列,每一個(gè)圖片大小的位置 絕對(duì)定位的計(jì)算

<template>
	<view class="con">
		<template v-if="viewWidth">
			<movable-area class="area" :style="{ height: areaHeight }" @mouseenter="mouseenter"
				@mouseleave="mouseleave">
				<movable-view v-for="(item, index) in imageList" :key="item.id" class="view" direction="all" :y="item.y"
					:x="item.x" :damping="40" :disabled="item.disable" @change="onChange($event, item)"
					@touchstart="touchstart(item)" @mousedown="touchstart(item)" @touchend="touchend(item)"
					@mouseup="touchend(item)" :style="{
					width: viewWidth + 'px', 
					height: viewWidth + 'px', 
					'z-index': item.zIndex, 
					opacity: item.opacity 
			}">
					<view class="area-con" :style="{
					width: childWidth, 
					height: childWidth, 
					borderRadius: borderRadius + 'rpx',
					transform: 'scale(' + item.scale + ')' 
					}">
						<image class="pre-image" :src="item.src" mode="aspectFill"></image>
						<view class="del-con" @click="delImages(item, index)" @touchstart.stop="delImageMp(item, index)"
							@touchend.stop="nothing()" @mousedown.stop="nothing()" @mouseup.stop="nothing()">
							<view class="del-wrap">
								<image class="del-image"
									src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+PHN2ZyBjbGFzcz0iaWNvbiIgd2lkdGg9IjIwMHB4IiBoZWlnaHQ9IjIwMC4wMHB4IiB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTYyNS40MjUzMDYgNjgxLjU4OTQ2NmwtMTE1LjQ3Mjk0MS0xMTUuNDcyOTQxLTExNS40NzE5MTggMTE1LjQ3Mjk0MS01NC4xMTc1NDgtNTQuMTE4NTcyIDExNS40NzE5MTgtMTE1LjQ3MTkxOC0xMTUuNDcxOTE4LTExNS40NzI5NDEgNTQuMTE3NTQ4LTU0LjExNzU0OCAxMTUuNDcxOTE4IDExNS40NzE5MTggMTE1LjQ3Mjk0MS0xMTUuNDcxOTE4IDU0LjExNzU0OCA1NC4xMTc1NDgtMTE1LjQ3Mjk0MSAxMTUuNDcyOTQxIDExNS40NzI5NDEgMTE1LjQ3MTkxOEw2MjUuNDI1MzA2IDY4MS41ODk0NjZ6TTc4MC41NDMxNzYgMjQxLjQwOTE4OWMtMTQ4LjgyNDUzNy0xNDguODI0NTM3LTM5Mi4zNTYwNjMtMTQ4LjgyNDUzNy01NDEuMTgwNiAwcy0xNDguODI0NTM3IDM5Mi4zNTUwMzkgMCA1NDEuMTc5NTc2IDM5Mi4zNTYwNjMgMTQ4LjgyNDUzNyA1NDEuMTgwNiAwQzkyOS4zNjc3MTMgNjMzLjc2NTI1MSA5MjkuMzY3NzEzIDM5MC4yMzM3MjYgNzgwLjU0MzE3NiAyNDEuNDA5MTg5eiIgZmlsbD0iI2RiZGJkYiIgLz48L3N2Zz4=">
								</image>
							</view>
						</view>
					</view>
				</movable-view>
				<view class="add" v-if="imageList.length < number"
					:style="{ top: add.y, left: add.x, width: viewWidth + 'px', height: viewWidth + 'px' }"
					@click="addImages">
					<view class="add-wrap"
						:style="{ width: childWidth, height: childWidth, borderRadius: borderRadius + 'rpx' }">
						+
					</view>
				</view>
			</movable-area>
		</template>
	</view>
</template>
<script>
	export default {
		emits: ['input', 'update:modelValue'],
		props: {
			// 排序圖片
			value: {
				type: Array,
				default: function() {
					return []
				}
			},
			// 排序圖片
			modelValue: {
				type: Array,
				default: function() {
					return []
				}
			},
			// 從 list 元素對(duì)象中讀取的鍵名
			keyName: {
				type: String,
				default: null
			},
			// 選擇圖片數(shù)量限制
			number: {
				type: Number,
				default: 9
			},
			// 圖片父容器寬度(實(shí)際顯示的圖片寬度為 imageWidth / 1.1 ),單位 rpx
			// imageWidth > 0 則 cols 無(wú)效
			imageWidth: {
				type: Number,
				default: 0
			},
			// 圖片列數(shù)
			cols: {
				type: Number,
				default: 3
			},
			// 圖片圓角,單位 rpx
			borderRadius: {
				type: Number,
				default: 10
			},
			// 圖片周?chē)瞻滋畛洌瑔挝?rpx
			padding: {
				type: Number,
				default: 10
			},
			// 拖動(dòng)圖片時(shí)放大倍數(shù) [0, ∞)
			scale: {
				type: Number,
				default: 1.1
			},
			// 拖動(dòng)圖片時(shí)不透明度
			opacity: {
				type: Number,
				default: 0.7
			},
			// 自定義添加
			addImage: {
				type: Function,
				default: null
			},
			// 刪除確認(rèn)
			delImage: {
				type: Function,
				default: null
			}
		},
		data() {
			return {
				imageList: [],
				width: 0,
				add: {
					x: 0,
					y: 0
				},
				colsValue: 0,
				viewWidth: 0,
				tempItem: null,
				timer: null,
				changeStatus: true,
				preStatus: true,
				first: true,
			}
		},
		computed: {
			areaHeight() {
				let height = ''
				// return '355px'
				if (this.imageList.length < this.number) {
					height = (Math.ceil((this.imageList.length + 1) / this.colsValue) * this.viewWidth).toFixed() + 'px'
				} else {
					height = (Math.ceil(this.imageList.length / this.colsValue) * this.viewWidth).toFixed() + 'px'
				}
				console.log('areaHeight', height)
				return height
			},
			childWidth() {
				return this.viewWidth - this.rpx2px(this.padding) * 2 + 'px'
			},
		},
		watch: {
			value: {
				handler(n) {
					if (!this.first && this.changeStatus) {
						console.log('watch', n)
						let flag = false
						for (let i = 0; i < n.length; i++) {
							if (flag) {
								this.addProperties(this.getSrc(n[i]))
								continue
							}
							if (this.imageList.length === i || this.imageList[i].src !== this.getSrc(n[i])) {
								flag = true
								this.imageList.splice(i)
								this.addProperties(this.getSrc(n[i]))
							}
						}
					}
				},
				deep: true
			},
			modelValue: {
				handler(n) {
					if (!this.first && this.changeStatus) {
						console.log('watch', n)
						let flag = false
						for (let i = 0; i < n.length; i++) {
							if (flag) {
								this.addProperties(this.getSrc(n[i]))
								continue
							}
							if (this.imageList.length === i || this.imageList[i].src !== this.getSrc(n[i])) {
								flag = true
								this.imageList.splice(i)
								this.addProperties(this.getSrc(n[i]))
							}
						}
					}
				},
				deep: true
			},
		},
		created() {
			// 獲取設(shè)備寬度
			this.width = uni.getSystemInfoSync().windowWidth
		},
		mounted() {
			// 獲取當(dāng)前的存放移動(dòng)區(qū)域的屬性
			const query = uni.createSelectorQuery().in(this)
			query.select('.con').boundingClientRect(data => {
				// 設(shè)置的三列 進(jìn)行傳值
				this.colsValue = this.cols
				// 元素寬度除以三進(jìn)行均分
				this.viewWidth = data.width / this.cols
				if (this.imageWidth > 0) {
					this.viewWidth = this.rpx2px(this.imageWidth)
					this.colsValue = Math.floor(data.width / this.viewWidth)
				}
				let list = this.value
				// #ifdef VUE3
				list = this.modelValue
				// #endif
				for (let item of list) {
					this.addProperties(this.getSrc(item))
				}
				this.first = false
			})
			query.exec()
		},
		methods: {
			// 傳的如果有鍵值就采取這個(gè)方法。沒(méi)有就不需要
			getSrc(item) {
				if (this.keyName !== null) {
					return item[this.keyName]
				}
				return item
			},
			onChange(e, item) {
				if (!item) return
				item.oldX = e.detail.x
				item.oldY = e.detail.y
				// 如果是拖動(dòng)狀態(tài)中
				if (e.detail.source === 'touch') {
					if (item.moveEnd) {
						item.offset = Math.sqrt(Math.pow(item.oldX - item.absX * this.viewWidth, 2) + Math.pow(item.oldY -
							item
							.absY * this.viewWidth, 2))
					}
					// x為 移動(dòng)時(shí)候的坐標(biāo)點(diǎn)加上劃定的一半的區(qū)域的和 除以劃定區(qū)域 去判斷有沒(méi)有超過(guò)自己定義的最大列數(shù)
					let x = Math.floor((e.detail.x + this.viewWidth / 2) / this.viewWidth)
					if (x >= this.colsValue) return
					// y同理  也是判斷超過(guò)高度沒(méi)有
					let y = Math.floor((e.detail.y + this.viewWidth / 2) / this.viewWidth)
					// index則是 如果是第一張圖片右移動(dòng)了半張圖片的位置 index就會(huì)加一
					let index = this.colsValue * y + x
					if (item.index != index && index < this.imageList.length) {
						this.changeStatus = false
						for (let obj of this.imageList) {
							// 判斷圖片是左右上下移動(dòng)  因?yàn)檫@個(gè)函數(shù)是一直觸發(fā)
							if (item.index > index && obj.index >= index && obj.index < item.index) {
								this.change(obj, 1)
							} else if (item.index < index && obj.index <= index && obj.index > item.index) {
								this.change(obj, -1)
							} else if (obj.id != item.id) {
								obj.offset = 0
								obj.x = obj.oldX
								obj.y = obj.oldY
								setTimeout(() => {
									this.$nextTick(() => {
										obj.x = obj.absX * this.viewWidth
										obj.y = obj.absY * this.viewWidth
									})
								}, 0)
							}
						}
						item.index = index
						item.absX = x
						item.absY = y
						if (!item.moveEnd) {
							setTimeout(() => {
								this.$nextTick(() => {
									item.x = item.absX * this.viewWidth
									item.y = item.absY * this.viewWidth
								})
							}, 0)
						}
						// console.log('bbb', JSON.parse(JSON.stringify(item)));
						// 移動(dòng)完成后重新排序
						this.sortList()
					}
				}
			},
			// change事件會(huì)隨著移動(dòng)函數(shù)一直觸發(fā),index隨之變化修改圖片的位置xy
			change(obj, i) {
				obj.index += i
				obj.offset = 0
				obj.x = obj.oldX
				obj.y = obj.oldY
				obj.absX = obj.index % this.colsValue
				obj.absY = Math.floor(obj.index / this.colsValue)
				setTimeout(() => {
					this.$nextTick(() => {
						obj.x = obj.absX * this.viewWidth
						obj.y = obj.absY * this.viewWidth
					})
				}, 0)
			},
			// 長(zhǎng)按圖片時(shí)候進(jìn)行所有的層級(jí)進(jìn)行加大 和放大
			touchstart(item) {
				this.imageList.forEach(v => {
					v.zIndex = v.index + 9
				})
				item.zIndex = 99
				item.moveEnd = true
				this.tempItem = item
				this.timer = setTimeout(() => {
					item.scale = this.scale
					item.opacity = this.opacity
					clearTimeout(this.timer)
					this.timer = null
				}, 200)
			},
			// 點(diǎn)擊一次沒(méi)有觸發(fā)四個(gè)變量的更改就會(huì)觸發(fā)previewImage 變成預(yù)覽
			// 拖拽過(guò)程中幾個(gè)變量會(huì)變,就不會(huì)觸發(fā)預(yù)覽 拖拽結(jié)束后就會(huì)縮小并且改變位置 
			touchend(item) {
				this.previewImage(item)
				item.scale = 1
				item.opacity = 1
				item.x = item.oldX
				item.y = item.oldY
				item.offset = 0
				item.moveEnd = false
				setTimeout(() => {
					this.$nextTick(() => {
						item.x = item.absX * this.viewWidth
						item.y = item.absY * this.viewWidth
						this.tempItem = null
						this.changeStatus = true
					})
					// console.log('ccc', JSON.parse(JSON.stringify(item)));
				}, 0)
				// console.log('ddd', JSON.parse(JSON.stringify(item)));
			},
			previewImage(item) {
				// timer是定時(shí)器 changeStatus是不是在移動(dòng)狀態(tài)中 只要點(diǎn)擊移動(dòng)了就是false  offset也是為0
				if (this.timer && this.preStatus && this.changeStatus && item.offset < 28.28) {
					clearTimeout(this.timer)
					this.timer = null
					const list = this.value || this.modelValue
					let srcList = list.map(v => this.getSrc(v))
					console.log(list, srcList);
					uni.previewImage({
						urls: srcList,
						current: item.src,
						success: () => {
							this.preStatus = false
							setTimeout(() => {
								this.preStatus = true
							}, 600)
						},
						fail: (e) => {
							console.log(e);
						}
					})
				} else if (this.timer) {
					clearTimeout(this.timer)
					this.timer = null
				}
			},
			mouseenter() {
				//#ifdef H5
				this.imageList.forEach(v => {
					v.disable = false
				})
				//#endif
			},
			mouseleave() {
				//#ifdef H5
				if (this.tempItem) {
					this.imageList.forEach(v => {
						v.disable = true
						v.zIndex = v.index + 9
						v.offset = 0
						v.moveEnd = false
						if (v.id == this.tempItem.id) {
							if (this.timer) {
								clearTimeout(this.timer)
								this.timer = null
							}
							v.scale = 1
							v.opacity = 1
							v.x = v.oldX
							v.y = v.oldY
							this.$nextTick(() => {
								v.x = v.absX * this.viewWidth
								v.y = v.absY * this.viewWidth
								this.tempItem = null
							})
						}
					})
					this.changeStatus = true
				}
				//#endif
			},
			addImages() {
				if (typeof this.addImage === 'function') {
					this.addImage.bind(this.$parent)()
				} else {
					let checkNumber = this.number - this.imageList.length
					uni.chooseImage({
						count: checkNumber,
						sourceType: ['album', 'camera'],
						success: res => {
							let count = checkNumber <= res.tempFilePaths.length ? checkNumber : res
								.tempFilePaths.length
							for (let i = 0; i < count; i++) {
								this.addProperties(res.tempFilePaths[i])
							}
							this.sortList()
						}
					})
				}
			},
			delImages(item, index) {
				if (typeof this.delImage === 'function') {
					this.delImage.bind(this.$parent)(() => {
						this.delImageHandle(item, index)
					})
				} else {
					this.delImageHandle(item, index)
				}
			},
			delImageHandle(item, index) {
				this.imageList.splice(index, 1)
				for (let obj of this.imageList) {
					if (obj.index > item.index) {
						obj.index -= 1
						obj.x = obj.oldX
						obj.y = obj.oldY
						obj.absX = obj.index % this.colsValue
						obj.absY = Math.floor(obj.index / this.colsValue)
						this.$nextTick(() => {
							obj.x = obj.absX * this.viewWidth
							obj.y = obj.absY * this.viewWidth
						})
					}
				}
				this.add.x = (this.imageList.length % this.colsValue) * this.viewWidth + 'px'
				this.add.y = Math.floor(this.imageList.length / this.colsValue) * this.viewWidth + 'px'
				this.sortList()
			},
			delImageMp(item, index) {
				//#ifdef MP
				this.delImages(item, index)
				//#endif
			},
			sortList() {
				console.log('sortList');
				const result = []
				let source = this.value
				// #ifdef VUE3
				source = this.modelValue
				// #endif
				// 使用slice進(jìn)行深拷貝
				let list = this.imageList.slice()
				// 小到大排序
				list.sort((a, b) => {
					return a.index - b.index
				})
				for (let s of list) {
					let item = source.find(d => this.getSrc(d) == s.src)
					if (item) {
						result.push(item)
					} else {
						if (this.keyName !== null) {
							result.push({
								[this.keyName]: s.src
							})
						} else {
							result.push(s.src)
						}
					}
				}
				this.$emit("input", result);
				this.$emit("update:modelValue", result);
			},
			addProperties(item) {
				console.log(item);
				// 這里的數(shù)組長(zhǎng)度還沒(méi)有。計(jì)算后push進(jìn)去才從0開(kāi)始計(jì)算
				// 數(shù)組長(zhǎng)度取列數(shù)的余數(shù) 1就取1 2就取2 3就是0 4就是1
				let absX = this.imageList.length % this.colsValue
				// 向下取整數(shù)組長(zhǎng)度除以列數(shù)  1/3取0  4/3取1
				let absY = Math.floor(this.imageList.length / this.colsValue)
				let x = absX * this.viewWidth
				let y = absY * this.viewWidth
				this.imageList.push({
					src: item,
					x,
					y,
					oldX: x,
					oldY: y,
					absX,
					absY,
					scale: 1,
					zIndex: 9,
					opacity: 1,
					index: this.imageList.length,
					id: this.guid(16),
					disable: false,
					offset: 0,
					moveEnd: false
				})
				this.add.x = (this.imageList.length % this.colsValue) * this.viewWidth + 'px'
				this.add.y = Math.floor(this.imageList.length / this.colsValue) * this.viewWidth + 'px'
			},
			nothing() {},
			rpx2px(v) {
				return this.width * v / 750
			},
			guid(len = 32) {
				const chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('')
				const uuid = []
				const radix = chars.length
				for (let i = 0; i < len; i++) uuid[i] = chars[0 | Math.random() * radix]
				uuid.shift()
				return `u${uuid.join('')}`
			}
		}
	}
</script>
<style lang="scss" scoped>
	.con {
		// padding: 30rpx;
		.area {
			width: 100%;
			.view {
				display: flex;
				justify-content: center;
				align-items: center;
				.area-con {
					position: relative;
					overflow: hidden;
					.pre-image {
						width: 100%;
						height: 100%;
					}
					.del-con {
						position: absolute;
						top: 0rpx;
						right: 0rpx;
						padding: 0 0 20rpx 20rpx;
						.del-wrap {
							width: 40rpx;
							height: 40rpx;
							// background-color: rgba(0, 0, 0, 0.4);
							border-radius: 0 0 0 10rpx;
							display: flex;
							justify-content: center;
							align-items: center;
							.del-image {
								width: 40rpx;
								height: 40rpx;
							}
						}
					}
				}
			}
			.add {
				position: absolute;
				display: flex;
				justify-content: center;
				align-items: center;
				.add-wrap {
					display: flex;
					justify-content: center;
					align-items: center;
					border: 1rpx solid #000;
					// background-color: #eeeeee;
				}
			}
		}
	}
</style>

到此這篇關(guān)于uniapp 拖拽圖片排序, 類(lèi)似于微信朋友圈的文章就介紹到這了,更多相關(guān)uniapp 拖拽圖片排序內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • Vue如何基于vue-i18n實(shí)現(xiàn)多國(guó)語(yǔ)言兼容

    Vue如何基于vue-i18n實(shí)現(xiàn)多國(guó)語(yǔ)言兼容

    這篇文章主要介紹了Vue如何基于vue-i18n實(shí)現(xiàn)多國(guó)語(yǔ)言兼容,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下
    2020-07-07
  • vue2?自定義?el-radio-button?的樣式并設(shè)置默認(rèn)值的方法

    vue2?自定義?el-radio-button?的樣式并設(shè)置默認(rèn)值的方法

    這篇文章主要介紹了vue2?自定義?el-radio-button?的樣式并設(shè)置默認(rèn)值的操作方法,代碼分為html部分和css修改樣式代碼,代碼簡(jiǎn)單易懂,對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2022-10-10
  • 簡(jiǎn)單聊一聊Vue3組件更新過(guò)程

    簡(jiǎn)單聊一聊Vue3組件更新過(guò)程

    我們不光要學(xué)會(huì)Vue的組件化實(shí)現(xiàn)過(guò)程,還要懂得組件數(shù)據(jù)發(fā)生變化,更新組件的過(guò)程,這篇文章主要給大家介紹了關(guān)于Vue3組件更新過(guò)程的相關(guān)資料,需要的朋友可以參考下
    2022-04-04
  • vue2.0 和 animate.css的結(jié)合使用

    vue2.0 和 animate.css的結(jié)合使用

    animate.css是一款前端動(dòng)畫(huà)庫(kù),相似的有velocity-animate。這篇文章給大家介紹vue2.0 和 animate.css的結(jié)合使用,需要的朋友參考下吧
    2017-12-12
  • vue移動(dòng)端項(xiàng)目渲染pdf步驟及問(wèn)題小結(jié)

    vue移動(dòng)端項(xiàng)目渲染pdf步驟及問(wèn)題小結(jié)

    這篇文章主要介紹了vue移動(dòng)端項(xiàng)目渲染pdf步驟,vue-pdf的插件在使用的過(guò)程中是連連踩坑的,基本遇到3個(gè)問(wèn)題,分別在文中給大家詳細(xì)介紹,需要的朋友可以參考下
    2022-08-08
  • 解決Vue的項(xiàng)目使用Element ui 走馬燈無(wú)法實(shí)現(xiàn)的問(wèn)題

    解決Vue的項(xiàng)目使用Element ui 走馬燈無(wú)法實(shí)現(xiàn)的問(wèn)題

    這篇文章主要介紹了解決Vue的項(xiàng)目使用Element ui 走馬燈無(wú)法實(shí)現(xiàn)的問(wèn)題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧
    2020-08-08
  • vue3的reactive賦值問(wèn)題解決

    vue3的reactive賦值問(wèn)題解決

    vue3中直接對(duì)reactive聲明的變量本身進(jìn)行賦值是無(wú)效的,本文主要介紹了vue3的reactive賦值問(wèn)題解決,具有一定的參考價(jià)值,感興趣的可以了解一下
    2024-03-03
  • 基于vue實(shí)現(xiàn)循環(huán)滾動(dòng)列表功能

    基于vue實(shí)現(xiàn)循環(huán)滾動(dòng)列表功能

    這篇文章給大家介紹基于vue實(shí)現(xiàn)循環(huán)滾動(dòng)列表功能,給大家介紹了該組件的用法,通過(guò)實(shí)例代碼給大家介紹的非常詳細(xì),需要的朋友參考下吧
    2021-09-09
  • Vue CLI3.0中使用jQuery和Bootstrap的方法

    Vue CLI3.0中使用jQuery和Bootstrap的方法

    這篇文章主要介紹了Vue CLI3.0中使用jQuery和Bootstrap的方法,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧
    2019-02-02
  • Vue高級(jí)組件之函數(shù)式組件的使用場(chǎng)景與源碼分析

    Vue高級(jí)組件之函數(shù)式組件的使用場(chǎng)景與源碼分析

    Vue提供了一種稱(chēng)為函數(shù)式組件的組件類(lèi)型,用來(lái)定義那些沒(méi)有響應(yīng)數(shù)據(jù),也不需要有任何生命周期的場(chǎng)景,它只接受一些props來(lái)顯示組件,下面這篇文章主要給大家介紹了關(guān)于Vue高級(jí)組件之函數(shù)式組件的使用場(chǎng)景與源碼分析的相關(guān)資料,需要的朋友可以參考下
    2021-11-11

最新評(píng)論