Skip to content

Commit

Permalink
Update router
Browse files Browse the repository at this point in the history
修改路由 以及代码结构
  • Loading branch information
jinhuid committed Jan 17, 2024
1 parent 1068cf8 commit 278f19c
Show file tree
Hide file tree
Showing 33 changed files with 975 additions and 1,053 deletions.
9 changes: 1 addition & 8 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset',
['@babel/preset-env', {
targets: {
ie:'11'
},
useBuiltIns: "usage",
corejs: '3.33.0'
}]
'@vue/cli-plugin-babel/preset'
],
plugins: [
['import', {
Expand Down
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<%= htmlWebpackPlugin.options.title %>
</title>
</head>

<script nomodule src="https://polyfill.io/v2/polyfill.min.js?features=IntersectionObserver"></script>
<body>
<div id="app"></div>
</body>
Expand Down
5 changes: 2 additions & 3 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
<!-- </ul> -->

<!-- <keep-alive>
<router-view></router-view>
</keep-alive> -->
<router-view></router-view>
</keep-alive> -->

<transition name="h" mode="out-in">
<keep-alive include="cinemas">
Expand Down Expand Up @@ -62,7 +62,6 @@ export default {
margin: 0;
padding: 0;
box-sizing: border-box;
/* user-select:auto; */
}
:root{
--textColor:#ff5f16;
Expand Down
59 changes: 29 additions & 30 deletions src/components/CinemaSwiper.vue
Original file line number Diff line number Diff line change
@@ -1,34 +1,33 @@
<template>
<div class="swiper-container">
<div class="swiper-wrapper">
<slot></slot>
</div>
</div>
<div class="swiper-container">
<div class="swiper-wrapper">
<slot></slot>
</div>
</div>
</template>
<script>
export default {
props:{
index:{
type:Number,
default:0
}
},
mounted() {
let that = this;
new this.$Swiper(".swiper-container", {
slideToClickedSlide: true,
speed:300,
slidesPerView: 4,
initialSlide: this.index,
spaceBetween: 16,
centeredSlides: true,
on:{
slideChangeTransitionStart(){
that.$emit('setIndex',this.activeIndex)
},
}
});
},
};
</script>
props: {
index: {
type: Number,
default: 0,
},
},
mounted() {
let that = this
new this.$Swiper(".swiper-container", {
slideToClickedSlide: true,
speed: 300,
slidesPerView: 4,
initialSlide: this.index,
spaceBetween: 16,
centeredSlides: true,
on: {
slideChangeTransitionStart() {
that.$emit("setIndex", this.activeIndex)
},
},
})
},
}
</script>
Loading

0 comments on commit 278f19c

Please sign in to comment.