添加事件

This commit is contained in:
fanshuai 2025-03-24 22:27:21 +08:00
parent d20a81da30
commit c59e8e3c37

View File

@ -34,7 +34,9 @@ export default {
const prevSlide = () => { const prevSlide = () => {
currentIndex.value = (currentIndex.value - 1 + slides.length) % slides.length currentIndex.value = (currentIndex.value - 1 + slides.length) % slides.length
} }
const geet = () => {
alert(`欢迎咨询`)
}
// //
onMounted(() => { onMounted(() => {
setInterval(nextSlide, 4000) setInterval(nextSlide, 4000)
@ -45,6 +47,7 @@ export default {
currentIndex, currentIndex,
nextSlide, nextSlide,
prevSlide, prevSlide,
geet,
} }
}, },
} }
@ -68,7 +71,7 @@ export default {
<div>客户案例</div> <div>客户案例</div>
<div>关于我们</div> <div>关于我们</div>
</div> </div>
<el-button class="an-3" type="primary">免费咨询</el-button> <el-button @click="geet" class="an-3" type="primary">免费咨询</el-button>
</div> </div>
</div> </div>
</el-header> </el-header>
@ -389,7 +392,7 @@ export default {
flex-direction: column; flex-direction: column;
justify-content: space-around; justify-content: space-around;
height: 250px; height: 250px;
margin-right: 300px;
background-color: #fff; background-color: #fff;
width: 600px; width: 600px;
margin-top: 50px; margin-top: 50px;
@ -402,7 +405,6 @@ export default {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-around; justify-content: space-around;
margin-right: 300px;
height: 500px; height: 500px;
margin-top: 50px; margin-top: 50px;
margin-left: 100px; margin-left: 100px;