Skip to content

Commit

Permalink
Merge branch 'upgrade/swiper' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuseduardomedeiros committed May 23, 2024
2 parents 9721397 + 38272e6 commit 3fdb2a8
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 46 deletions.
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,17 @@
"axios": "^1.6.7",
"logrocket": "^8.1.0",
"moment": "^2.30.1",
"swiper": "^11.0.7",
"pinia": "^2.1.7",
"swiper": "^11.1.3",
"vue": "^3.3.11",
"vue-awesome-swiper": "^5.0.1",
"vue-router": "^4.2.5",
"pinia": "^2.1.7"
"vue-router": "^4.2.5"
},
"devDependencies": {
"@rushstack/eslint-patch": "^1.3.3",
"@vue/test-utils": "^2.4.4",
"@vitejs/plugin-vue": "^4.5.2",
"@vue/compiler-sfc": "^3.4.21",
"@vue/eslint-config-prettier": "^8.0.0",
"@vue/test-utils": "^2.4.4",
"@weni/eslint-config": "^1.0.1",
"eslint": "^7.0.0",
"eslint-config-prettier": "^9.1.0",
Expand Down
6 changes: 2 additions & 4 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ import { createPinia } from 'pinia';
import { useRoute, useRouter } from 'vue-router';
import App from './App.vue';
import router from './router';
import VueAwesomeSwiper from 'vue-awesome-swiper';

import Unnnic from './utils/plugins/UnnnicSystem';
import '@weni/unnnic-system/dist/style.css';

// import style (>= Swiper 6.x)
import 'swiper/swiper-bundle.css';
// Only core Swiper styles
import 'swiper/css';

const app = createApp(App);
const pinia = createPinia();
Expand All @@ -22,7 +21,6 @@ pinia.use(({ store }) => {
store.$router = markRaw(useRouter());
});

app.use(VueAwesomeSwiper);
app.use(Unnnic);

app.mount('#app');
Expand Down
38 changes: 16 additions & 22 deletions src/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,28 +43,28 @@
name: 'ClassesListAll',
params: { id_category: category.id },
}"
>Ver tudo</RouterLink
>
Ver tudo
</RouterLink>
<UnnnicButtonIcon
type="secondary"
size="small"
icon="arrow-left-1-1"
class=".swiper-button-prev"
@click="backSlide(index)"
/>
<UnnnicButtonIcon
type="secondary"
size="small"
icon="arrow-right-1-1"
class=".swiper-button-next"
@click="nextSlide(index)"
/>
</div>
</div>
<Swiper
ref="mySwiperRef"
class="section__item__list swiper"
:options="swiperOption"
:class="`section__item__list swiper swiper-${index}`"
:slidesPerView="swiperOptions.slidesPerView"
:spaceBetween="swiperOptions.spaceBetween"
@init="addSwiperRef(index, $event)"
>
<SwiperSlide
href=""
Expand Down Expand Up @@ -106,21 +106,18 @@
// import Ia from '@/components/tabs/iaTab.vue';
import { useModulesStore } from '@/stores/modules';
import { mapState, mapActions } from 'pinia';
import { Swiper, SwiperSlide } from 'vue-awesome-swiper';
import { Swiper, SwiperSlide } from 'swiper/vue';
import Banner from '@/components/Banner.vue';
export default {
// eslint-disable-next-line vue/multi-word-component-names
name: 'Home',
data() {
return {
swiperOption: {
swipersRefs: {},
swiperOptions: {
slidesPerView: 3,
spaceBetween: 16,
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
},
colors: [
'green-yellow',
Expand Down Expand Up @@ -150,11 +147,14 @@ export default {
},
methods: {
...mapActions(useModulesStore, ['fetchSingleModule']),
addSwiperRef(index, swiper) {
this.swipersRefs[index] = swiper;
},
backSlide(index) {
this.$refs.mySwiperRef[index].$swiper.slidePrev();
this.swipersRefs[index].slidePrev();
},
nextSlide(index) {
this.$refs.mySwiperRef[index].$swiper.slideNext();
this.swipersRefs[index].slideNext();
},
getAllClasses(category) {
return category.class_set.length;
Expand All @@ -168,10 +168,7 @@ export default {
},
},
computed: {
...mapState(useModulesStore, [
'currentModule',
'modules',
]),
...mapState(useModulesStore, ['currentModule', 'modules']),
},
};
</script>
Expand Down Expand Up @@ -208,9 +205,6 @@ export default {
}
}
.section__item__list {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: $unnnic-spacing-stack-md;
padding: $unnnic-inline-lg 0 $unnnic-inline-md;
.card {
height: 100%;
Expand All @@ -224,4 +218,4 @@ export default {
}
}
}
</style>
</style>
47 changes: 32 additions & 15 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2673,8 +2673,16 @@ stdout-stream@^1.4.0:
dependencies:
readable-stream "^2.0.1"

"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
name string-width-cjs
"string-width-cjs@npm:string-width@^4.2.0":
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
dependencies:
emoji-regex "^8.0.0"
is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.1"

"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
Expand Down Expand Up @@ -2706,8 +2714,14 @@ string_decoder@~1.1.1:
dependencies:
safe-buffer "~5.1.0"

"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
name strip-ansi-cjs
"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
dependencies:
ansi-regex "^5.0.1"

strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
Expand Down Expand Up @@ -2752,10 +2766,10 @@ supports-preserve-symlinks-flag@^1.0.0:
resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09"
integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==

swiper@^11.0.7:
version "11.0.7"
resolved "https://registry.yarnpkg.com/swiper/-/swiper-11.0.7.tgz#fe51bb64546c2c21a1ec6914e7764af953443ded"
integrity sha512-cDfglW1B6uSmB6eB6pNmzDTNLmZtu5bWWa1vak0RU7fOI9qHjMzl7gVBvYSl34b0RU2N11HxxETJqQ5LeqI1cA==
swiper@^11.1.3:
version "11.1.3"
resolved "https://registry.yarnpkg.com/swiper/-/swiper-11.1.3.tgz#ff5cbeea349d207a2423c4106b1905cb12804a19"
integrity sha512-80MSxonyTxrGcaWj9YgvvhD8OG0B9/9IVZP33vhIEvyWvmKjnQDBieO+29wKvMx285sAtvZyrWBdkxaw6+D3aw==

synckit@^0.8.6:
version "0.8.8"
Expand Down Expand Up @@ -2906,11 +2920,6 @@ vite@^5.0.10:
optionalDependencies:
fsevents "~2.3.3"

vue-awesome-swiper@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/vue-awesome-swiper/-/vue-awesome-swiper-5.0.1.tgz#ba0d20ec9ca4dff2b7b4e99592cf59308335dfcc"
integrity sha512-mWjFJzUqA4lG+DmsmibvMpoiBnl+IH2SSeiiQ3i5M0t1y9FknTxnGT0DsMb2YdJLgjYMEK3sYOWzqgLnZMH8Lg==

vue-component-type-helpers@^1.8.21:
version "1.8.27"
resolved "https://registry.yarnpkg.com/vue-component-type-helpers/-/vue-component-type-helpers-1.8.27.tgz#e816c82dcffac8bca58833c120ba395c325dfa68"
Expand Down Expand Up @@ -2980,8 +2989,16 @@ wide-align@^1.1.5:
dependencies:
string-width "^1.0.2 || 2 || 3 || 4"

"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
name wrap-ansi-cjs
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
dependencies:
ansi-styles "^4.0.0"
string-width "^4.1.0"
strip-ansi "^6.0.0"

wrap-ansi@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
Expand Down

0 comments on commit 3fdb2a8

Please sign in to comment.