Vue3實(shí)現(xiàn)圖片放大鏡效果的完整方案
大家好!今天分享一個(gè)非常實(shí)用的前端功能:圖片放大鏡效果。這個(gè)效果在電商網(wǎng)站、圖片展示平臺(tái)中非常常見,比如查看商品細(xì)節(jié)時(shí)特別好用。
效果預(yù)覽
先來(lái)看看最終實(shí)現(xiàn)的效果:

- 鼠標(biāo)移動(dòng)到圖片上會(huì)出現(xiàn)一個(gè)放大鏡框
- 右側(cè)會(huì)顯示放大后的局部細(xì)節(jié)
- 支持自定義放大倍數(shù)、鏡片大小和放大區(qū)域尺寸
- 實(shí)現(xiàn)了像素級(jí)精準(zhǔn)的放大效果
- 帶有詳細(xì)的調(diào)試信息展示
核心原理
圖片放大鏡效果的核心原理其實(shí)很簡(jiǎn)單:通過(guò)計(jì)算鼠標(biāo)位置,在原始圖片上確定一個(gè)查看區(qū)域,然后將這個(gè)區(qū)域按比例放大顯示。
聽起來(lái)簡(jiǎn)單,但實(shí)現(xiàn)起來(lái)有幾個(gè)關(guān)鍵點(diǎn)需要特別注意:
1.坐標(biāo)映射:如何將鼠標(biāo)在顯示圖片上的位置,精確映射到原始圖片上的對(duì)應(yīng)位置 2.比例計(jì)算:處理圖片原始尺寸和顯示尺寸之間的比例關(guān)系 3.邊界處理:確保放大鏡不會(huì)跑出圖片范圍 4.性能優(yōu)化:保證交互的流暢性
代碼實(shí)現(xiàn)詳解
HTML 結(jié)構(gòu)
<div class="magnifier-container">
<!-- 原始圖片區(qū)域 -->
<div class="image-section">
<div class="original-image-container"
@mousemove="handleMouseMove"
@mouseleave="isVisible = false"
@mouseenter="isVisible = true">
<img ref="originalImage" src="圖片地址" @load="handleImageLoad" />
<div class="zoom-lens" :style="鏡片樣式"></div>
</div>
</div>
<!-- 放大區(qū)域 -->
<div class="zoomed-section">
<div class="zoomed-image-container">
<div v-if="!isVisible" class="placeholder">
<p>將鼠標(biāo)懸停在左側(cè)圖片上查看放大效果</p>
</div>
<div v-else class="zoomed-image" :style="放大圖片樣式"></div>
</div>
</div>
</div>
這個(gè)結(jié)構(gòu)分為兩個(gè)主要部分:
- 左側(cè)是原始圖片和跟隨鼠標(biāo)的放大鏡鏡片
- 右側(cè)是放大后的圖片顯示區(qū)域
Vue3 響應(yīng)式數(shù)據(jù)
setup() {
// 圖片相關(guān)引用和尺寸數(shù)據(jù)
const originalImage = ref(null);
const originalWidth = ref(0); // 圖片原始寬度
const originalHeight = ref(0); // 圖片原始高度
const displayWidth = ref(0); // 圖片顯示寬度
const displayHeight = ref(0); // 圖片顯示高度
// 放大鏡狀態(tài)
const lensPosition = ref({ x: 0, y: 0 }); // 鏡片位置
const isVisible = ref(false); // 是否顯示放大鏡
const imageLoaded = ref(false); // 圖片是否加載完成
// 配置參數(shù)
const lensSize = ref(150); // 鏡片大小
const zoomedSize = ref(400); // 放大區(qū)域大小
const zoomLevel = ref(2); // 放大倍數(shù)
}
關(guān)鍵技術(shù)點(diǎn)解析
1. 比例計(jì)算
這是整個(gè)功能最核心的部分!當(dāng)圖片在網(wǎng)頁(yè)上顯示時(shí),它的顯示尺寸可能不等于原始尺寸(比如響應(yīng)式布局中圖片會(huì)自適應(yīng)容器大小)。我們需要精確計(jì)算這個(gè)比例關(guān)系:
const scaleX = computed(() => {
if (!imageLoaded.value) return 1;
return originalWidth.value / displayWidth.value;
});
const scaleY = computed(() => {
if (!imageLoaded.value) return 1;
return originalHeight.value / displayHeight.value;
});
舉個(gè)例子:
- 如果圖片原始寬度是 1200px,顯示寬度是 600px
- 那么 scaleX 就是 2,意味著顯示圖片上的 1 像素對(duì)應(yīng)原始圖片的 2 像素
2. 鼠標(biāo)位置追蹤
const handleMouseMove = (e) => {
if (!originalImage.value || !imageLoaded.value) return;
// 獲取圖片相對(duì)于視口的位置
const rect = originalImage.value.getBoundingClientRect();
// 計(jì)算鼠標(biāo)在圖片內(nèi)的相對(duì)位置
const mouseX = e.clientX - rect.left;
const mouseY = e.clientY - rect.top;
// 計(jì)算鏡片位置(讓鏡片中心對(duì)準(zhǔn)鼠標(biāo))
let x = mouseX - lensSize.value / 2;
let y = mouseY - lensSize.value / 2;
// 邊界限制,防止鏡片跑出圖片外
const maxX = Math.max(0, displayWidth.value - lensSize.value);
const maxY = Math.max(0, displayHeight.value - lensSize.value);
x = Math.max(0, Math.min(x, maxX));
y = Math.max(0, Math.min(y, maxY));
lensPosition.value = {
x: Math.round(x * 1000) / 1000, // 高精度數(shù)值
y: Math.round(y * 1000) / 1000
};
};
3. 原始圖片位置計(jì)算
有了鼠標(biāo)在顯示圖片上的位置,我們需要找到它在原始圖片上的對(duì)應(yīng)位置:
const originalX = computed(() => {
if (!imageLoaded.value) return 0;
// 計(jì)算鏡片中心在顯示圖片上的位置
const lensCenterX = lensPosition.value.x + lensSize.value / 2;
// 映射到原始圖片上的位置
const pos = lensCenterX * scaleX.value;
return Math.max(0, Math.min(pos, originalWidth.value));
});
4. 放大區(qū)域背景定位
這是實(shí)現(xiàn)放大效果的關(guān)鍵:我們通過(guò) CSS 的 background-position 來(lái)移動(dòng)背景圖片,創(chuàng)造出放大效果:
const backgroundPosition = computed(() => {
if (!imageLoaded.value) return { x: 0, y: 0 };
// 計(jì)算在放大視圖中的目標(biāo)中心點(diǎn)
const targetCenterX = originalX.value * zoomLevel.value;
const targetCenterY = originalY.value * zoomLevel.value;
// 計(jì)算背景位置,使目標(biāo)點(diǎn)出現(xiàn)在放大區(qū)域中心
let bgX = targetCenterX - zoomedSize.value / 2;
let bgY = targetCenterY - zoomedSize.value / 2;
// 邊界處理
const maxBgX = Math.max(0, originalWidth.value * zoomLevel.value - zoomedSize.value);
const maxBgY = Math.max(0, originalHeight.value * zoomLevel.value - zoomedSize.value);
bgX = Math.max(0, Math.min(bgX, maxBgX));
bgY = Math.max(0, Math.min(bgY, maxBgY));
return { x: bgX, y: bgY };
});
const getZoomedImageStyle = () => {
const bgSize = `${originalWidth.value * zoomLevel.value}px ${originalHeight.value * zoomLevel.value}px`;
const bgPosition = `-${backgroundPosition.value.x}px -${backgroundPosition.value.y}px`;
return {
backgroundImage: `url(${imageUrl.value})`,
backgroundSize: bgSize, // 設(shè)置背景圖片大小為放大后的尺寸
backgroundPosition: bgPosition, // 移動(dòng)背景圖片來(lái)顯示正確區(qū)域
transform: `translateZ(0)`, // 開啟硬件加速,提高性能
};
};
圖片加載處理
我們需要在圖片完全加載后獲取其真實(shí)尺寸:
const handleImageLoad = () => {
originalWidth.value = originalImage.value.naturalWidth;
originalHeight.value = originalImage.value.naturalHeight;
displayWidth.value = originalImage.value.clientWidth;
displayHeight.value = originalImage.value.clientHeight;
imageLoaded.value = true;
};
樣式設(shè)計(jì)要點(diǎn)
鏡片樣式
.zoom-lens {
position: absolute;
border: 2px solid white;
background-color: rgba(52, 152, 219, 0.2); /* 半透明藍(lán)色 */
box-shadow: 0 0 15px rgba(0, 0, 0, 0.3); /* 陰影增強(qiáng)視覺(jué)效果 */
pointer-events: none; /* 重要!防止鏡片干擾鼠標(biāo)事件 */
z-index: 10;
}
放大區(qū)域樣式
.zoomed-image-container {
border-radius: 8px;
overflow: hidden;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
background: #f8f9fa; /* 默認(rèn)背景色 */
height: 400px;
display: flex;
align-items: center;
justify-content: center;
}
調(diào)試和優(yōu)化技巧
我們的實(shí)現(xiàn)中包含了一個(gè)實(shí)用的調(diào)試面板,可以實(shí)時(shí)顯示各種計(jì)算數(shù)據(jù):
- 比例因子:顯示原始圖片與顯示圖片的尺寸比例
- 位置信息:顯示鼠標(biāo)位置、鏡片位置和背景位置
- 計(jì)算精度:評(píng)估坐標(biāo)映射的準(zhǔn)確度
- 像素偏差:顯示實(shí)際位置與理想位置的偏差
這些調(diào)試信息在開發(fā)過(guò)程中非常有用,可以幫助我們快速定位問(wèn)題。
常見問(wèn)題及解決方案
1. 圖片閃爍或跳動(dòng)
原因:計(jì)算精度不夠或邊界處理不當(dāng) 解決:使用更高精度的計(jì)算(我們代碼中使用了三位小數(shù)),并仔細(xì)處理所有邊界情況
2. 性能問(wèn)題
原因:mousemove 事件觸發(fā)頻率很高 解決:
- 使用 Vue 的響應(yīng)式系統(tǒng),它已經(jīng)做了優(yōu)化
- 避免在 mousemove 中執(zhí)行復(fù)雜操作
- 使用
transform: translateZ(0)開啟硬件加速
3. 圖片加載問(wèn)題
原因:在圖片加載完成前就進(jìn)行計(jì)算 解決:使用 @load 事件確保圖片完全加載后再初始化功能
總結(jié)
通過(guò)這篇文章,我們不僅實(shí)現(xiàn)了一個(gè)功能完整的圖片放大鏡效果,還深入理解了其背后的原理和實(shí)現(xiàn)細(xì)節(jié)。關(guān)鍵點(diǎn)在于:
- 精確的坐標(biāo)映射和比例計(jì)算
- 完善的邊界處理
- 利用 CSS 背景定位實(shí)現(xiàn)放大效果
- 良好的用戶體驗(yàn)和性能優(yōu)化
希望這篇文章對(duì)你有幫助!如果你有任何問(wèn)題或建議,歡迎在評(píng)論區(qū)留言討論。
完整代碼
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vue3 圖片放大鏡效果</title>
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
<style>
body {
padding-top: 20px;
}
.container {
max-width: 1200px;
margin: 0 auto;
}
header {
text-align: center;
margin-bottom: 30px;
}
h1 {
color: #2c3e50;
margin-bottom: 10px;
font-size: 2.2rem;
}
.magnifier-app {
background: white;
border-radius: 12px;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
padding: 25px;
margin-bottom: 30px;
}
.config-info {
text-align: center;
margin-bottom: 25px;
padding: 15px;
background: #f8f9fa;
border-radius: 8px;
color: #495057;
}
.magnifier-container {
display: flex;
flex-wrap: wrap;
gap: 30px;
justify-content: center;
}
.image-section {
flex: 1;
min-width: 300px;
}
.original-image-container {
position: relative;
cursor: crosshair;
border-radius: 8px;
overflow: hidden;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}
.original-image-container img {
display: block;
width: 100%;
height: auto;
}
.zoom-lens {
position: absolute;
border: 2px solid white;
background-color: rgba(52, 152, 219, 0.2);
box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
pointer-events: none;
z-index: 10;
}
.zoomed-section {
flex: 1;
min-width: 300px;
}
.zoomed-image-container {
border-radius: 8px;
overflow: hidden;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
background: #f8f9fa;
height: 400px;
display: flex;
align-items: center;
justify-content: center;
position: relative;
}
.zoomed-image {
width: 100%;
height: 100%;
background-repeat: no-repeat;
image-rendering: -webkit-optimize-contrast;
image-rendering: crisp-edges;
}
.placeholder {
color: #7f8c8d;
text-align: center;
padding: 20px;
}
.instructions {
text-align: center;
margin-top: 20px;
color: #7f8c8d;
font-style: italic;
}
.status {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 20px;
margin-top: 15px;
font-size: 0.9rem;
color: #7f8c8d;
}
.debug-info {
background: #f8f9fa;
padding: 15px;
border-radius: 8px;
margin-top: 20px;
font-family: monospace;
font-size: 0.85rem;
}
.pixel-grid {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-image:
linear-gradient(rgba(0,0,0,0.1) 1px, transparent 1px),
linear-gradient(90deg, rgba(0,0,0,0.1) 1px, transparent 1px);
background-size: 10px 10px;
pointer-events: none;
opacity: 0.3;
}
@media (max-width: 768px) {
.magnifier-container {
flex-direction: column;
}
}
</style>
</head>
<body>
<div id="app">
<div class="container">
<header>
<h1>Vue3 圖片放大鏡效果</h1>
</header>
<div class="magnifier-app">
<div class="config-info">
<p>當(dāng)前配置:鏡片大小 {{ lensSize }}px | 放大區(qū)域 {{ zoomedSize }}px | 放大倍數(shù) {{ zoomLevel }}x</p>
</div>
<div class="magnifier-container">
<div class="image-section">
<div class="original-image-container"
@mousemove="handleMouseMove"
@mouseleave="isVisible = false"
@mouseenter="isVisible = true">
<img
ref="originalImage"
src="https://picsum.photos/600/400"
alt="Original Image"
@load="handleImageLoad"
/>
<div
class="zoom-lens"
:style="{
width: lensSize + 'px',
height: lensSize + 'px',
left: lensPosition.x + 'px',
top: lensPosition.y + 'px',
display: isVisible && imageLoaded ? 'block' : 'none'
}"
></div>
</div>
</div>
<div class="zoomed-section">
<div
class="zoomed-image-container"
:style="{
width: zoomedSize + 'px',
height: zoomedSize + 'px'
}"
>
<div v-if="!isVisible || !imageLoaded" class="placeholder">
<p>將鼠標(biāo)懸停在左側(cè)圖片上查看放大效果</p>
</div>
<div
v-else
class="zoomed-image"
:style="getZoomedImageStyle()"
></div>
<div class="pixel-grid" v-if="isVisible && imageLoaded"></div>
</div>
</div>
</div>
<div class="status">
<div>圖片原始尺寸: {{ originalWidth }} × {{ originalHeight }}px</div>
<div>圖片顯示尺寸: {{ displayWidth }} × {{ displayHeight }}px</div>
<div>放大鏡位置: X:{{ Math.round(lensPosition.x * 1000) / 1000 }}, Y:{{ Math.round(lensPosition.y * 1000) / 1000 }}</div>
</div>
<div class="debug-info" v-if="imageLoaded">
<div>比例因子: X={{ scaleX.toFixed(8) }}, Y={{ scaleY.toFixed(8) }}</div>
<div>原始圖片位置: X={{ Math.round(originalX * 1000) / 1000 }}, Y={{ Math.round(originalY * 1000) / 1000 }}</div>
<div>背景位置: X:{{ Math.round(backgroundPosition.x * 1000) / 1000 }}, Y:{{ Math.round(backgroundPosition.y * 1000) / 1000 }}</div>
<div>計(jì)算精度: {{ (calculationAccuracy * 100).toFixed(6) }}%</div>
<div>像素偏差: X:{{ Math.abs(pixelDeviation.x).toFixed(3) }}px, Y:{{ Math.abs(pixelDeviation.y).toFixed(3) }}px</div>
</div>
</div>
</div>
</div>
<script>
const { createApp, ref, computed } = Vue;
createApp({
setup() {
const originalImage = ref(null);
const originalWidth = ref(0);
const originalHeight = ref(0);
const displayWidth = ref(0);
const displayHeight = ref(0);
const lensPosition = ref({ x: 0, y: 0 });
const isVisible = ref(false);
const imageLoaded = ref(false);
const imageUrl = ref('https://picsum.photos/600/400');
// 使用最精準(zhǔn)的默認(rèn)參數(shù)
const lensSize = ref(150);
const zoomedSize = ref(400);
const zoomLevel = ref(2);
// 計(jì)算比例因子 - 使用超高精度計(jì)算
const scaleX = computed(() => {
if (!imageLoaded.value) return 1;
const scale = originalWidth.value / displayWidth.value;
return scale;
});
const scaleY = computed(() => {
if (!imageLoaded.value) return 1;
const scale = originalHeight.value / displayHeight.value;
return scale;
});
// 計(jì)算原始圖片上的精確位置 - 超高精度版本
const originalX = computed(() => {
if (!imageLoaded.value) return 0;
const lensCenterX = lensPosition.value.x + lensSize.value / 2;
const pos = lensCenterX * scaleX.value;
return Math.max(0, Math.min(pos, originalWidth.value));
});
const originalY = computed(() => {
if (!imageLoaded.value) return 0;
const lensCenterY = lensPosition.value.y + lensSize.value / 2;
const pos = lensCenterY * scaleY.value;
return Math.max(0, Math.min(pos, originalHeight.value));
});
// 像素級(jí)偏差計(jì)算
const pixelDeviation = computed(() => {
if (!imageLoaded.value) return { x: 0, y: 0 };
// 計(jì)算理論上的完美位置
const perfectBgX = originalX.value * zoomLevel.value - zoomedSize.value / 2;
const perfectBgY = originalY.value * zoomLevel.value - zoomedSize.value / 2;
return {
x: backgroundPosition.value.x - perfectBgX,
y: backgroundPosition.value.y - perfectBgY
};
});
// 計(jì)算精度評(píng)估 - 更嚴(yán)格的評(píng)估標(biāo)準(zhǔn)
const calculationAccuracy = computed(() => {
if (!imageLoaded.value) return 0;
const maxDeviation = Math.max(zoomedSize.value * 0.01, 2); // 允許1%或2像素的偏差
const xAccuracy = Math.max(0, 1 - Math.abs(pixelDeviation.value.x) / maxDeviation);
const yAccuracy = Math.max(0, 1 - Math.abs(pixelDeviation.value.y) / maxDeviation);
return (xAccuracy + yAccuracy) / 2;
});
// 超精準(zhǔn)背景位置計(jì)算算法
const backgroundPosition = computed(() => {
if (!imageLoaded.value) return { x: 0, y: 0 };
// 核心算法:確保像素級(jí)精確對(duì)應(yīng)
const targetCenterX = originalX.value * zoomLevel.value;
const targetCenterY = originalY.value * zoomLevel.value;
// 計(jì)算背景位置,使放大區(qū)域中心精確顯示目標(biāo)位置
let bgX = targetCenterX - zoomedSize.value / 2;
let bgY = targetCenterY - zoomedSize.value / 2;
// 精確的邊界處理
const maxBgX = Math.max(0, originalWidth.value * zoomLevel.value - zoomedSize.value);
const maxBgY = Math.max(0, originalHeight.value * zoomLevel.value - zoomedSize.value);
// 使用更精確的邊界檢查
bgX = Math.max(0, Math.min(bgX, maxBgX));
bgY = Math.max(0, Math.min(bgY, maxBgY));
// 強(qiáng)制像素對(duì)齊 - 消除亞像素渲染問(wèn)題
bgX = Math.round(bgX * 1000) / 1000;
bgY = Math.round(bgY * 1000) / 1000;
return { x: bgX, y: bgY };
});
const handleImageLoad = () => {
originalWidth.value = originalImage.value.naturalWidth;
originalHeight.value = originalImage.value.naturalHeight;
displayWidth.value = originalImage.value.clientWidth;
displayHeight.value = originalImage.value.clientHeight;
imageLoaded.value = true;
console.log('=== 超高精度圖片加載信息 ===');
console.log('原始尺寸:', `${originalWidth.value}x${originalHeight.value}`);
console.log('顯示尺寸:', `${displayWidth.value}x${displayHeight.value}`);
console.log('比例因子:', `X=${scaleX.value.toFixed(8)}, Y=${scaleY.value.toFixed(8)}`);
};
const handleMouseMove = (e) => {
if (!originalImage.value || !imageLoaded.value) return;
const rect = originalImage.value.getBoundingClientRect();
// 超高精度的鼠標(biāo)位置計(jì)算
const mouseX = e.clientX - rect.left;
const mouseY = e.clientY - rect.top;
// 計(jì)算放大鏡位置(中心對(duì)齊)
let x = mouseX - lensSize.value / 2;
let y = mouseY - lensSize.value / 2;
// 精確的邊界限制
const maxX = Math.max(0, displayWidth.value - lensSize.value);
const maxY = Math.max(0, displayHeight.value - lensSize.value);
x = Math.max(0, Math.min(x, maxX));
y = Math.max(0, Math.min(y, maxY));
// 使用更高精度的數(shù)值
lensPosition.value = {
x: Math.round(x * 1000) / 1000,
y: Math.round(y * 1000) / 1000
};
};
const getZoomedImageStyle = () => {
const bgSize = `${originalWidth.value * zoomLevel.value}px ${originalHeight.value * zoomLevel.value}px`;
const bgPosition = `-${backgroundPosition.value.x}px -${backgroundPosition.value.y}px`;
return {
backgroundImage: `url(${imageUrl.value})`,
backgroundSize: bgSize,
backgroundPosition: bgPosition,
transform: `translateZ(0)`, // 硬件加速
backgroundOrigin: 'border-box'
};
};
return {
originalImage,
originalWidth,
originalHeight,
displayWidth,
displayHeight,
lensPosition,
backgroundPosition,
isVisible,
imageLoaded,
imageUrl,
lensSize,
zoomedSize,
zoomLevel,
scaleX,
scaleY,
originalX,
originalY,
calculationAccuracy,
pixelDeviation,
handleImageLoad,
handleMouseMove,
getZoomedImageStyle
};
}
}).mount('#app');
</script>
</body>
</html>
以上就是Vue3實(shí)現(xiàn)圖片放大鏡效果的完整方案的詳細(xì)內(nèi)容,更多關(guān)于Vue3圖片放大鏡效果的資料請(qǐng)關(guān)注腳本之家其它相關(guān)文章!
相關(guān)文章
vue-cli創(chuàng)建項(xiàng)目及項(xiàng)目結(jié)構(gòu)解析
上一篇我們安裝了vue-cli,接下來(lái)我們就使用該腳手架進(jìn)行創(chuàng)建項(xiàng)目,這篇文章主要介紹了vue-cli創(chuàng)建項(xiàng)目以及項(xiàng)目結(jié)構(gòu)的相關(guān)資料,需要的朋友可以參考下面文章的具體內(nèi)容2021-10-10
Vue用mixin合并重復(fù)代碼的實(shí)現(xiàn)
這篇文章主要介紹了Vue用mixin合并重復(fù)代碼的實(shí)現(xiàn),文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2020-11-11
vue前端實(shí)現(xiàn)批量上傳圖片功能并回顯圖片
這篇文章主要為大家詳細(xì)介紹了vue前端實(shí)現(xiàn)批量上傳圖片功能并回顯圖片的相關(guān)知識(shí),文中的示例代碼講解詳細(xì),感興趣的小伙伴可以跟隨小編一起學(xué)習(xí)一下2025-10-10
ant?design?vue?pro?支持多頁(yè)簽?zāi)J絾?wèn)題
這篇文章主要介紹了ant?design?vue?pro?支持多頁(yè)簽?zāi)J絾?wèn)題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2023-11-11
vue+element創(chuàng)建動(dòng)態(tài)的form表單及動(dòng)態(tài)生成表格的行和列
這篇文章主要介紹了vue+element創(chuàng)建動(dòng)態(tài)的form表單及動(dòng)態(tài)生成表格的行和列 ,本文通過(guò)實(shí)例代碼給大家介紹的非常詳細(xì),具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2019-05-05
vue生命周期四個(gè)階段created和mount詳解
這篇文章主要介紹了vue生命周期四個(gè)階段created和mount,本文給大家介紹的非常詳細(xì),補(bǔ)充介紹了什么是實(shí)例,什么是實(shí)例被掛載到DOM,什么是dom,dao操作又是什么,感興趣的朋友跟隨小編一起看看吧2024-02-02

