dev #20

Merged
jiangx merged 2 commits from dev into test 2 years ago
  1. 2
      CHANGELOG.md
  2. 2
      package-lock.json
  3. 2
      package.json
  4. 4
      src/App.vue
  5. 20
      src/components/ScrollList/ScrollList.vue

2
CHANGELOG.md

@ -2,6 +2,8 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
## [1.0.0-B.20](https://git.1000my.com/project_yongwangyun/YongWang_Customer/compare/v1.0.0-B.19...v1.0.0-B.20) (2024-03-25)
## [1.0.0-B.19](https://git.1000my.com/project_yongwangyun/YongWang_Customer/compare/v1.0.0-B.18...v1.0.0-B.19) (2024-01-16)
## [1.0.0-B.18](https://git.1000my.com/project_yongwangyun/YongWang_Customer/compare/v1.0.0-B.17...v1.0.0-B.18) (2024-01-16)

2
package-lock.json

@ -1,6 +1,6 @@
{
"name": "vue_cli_ts",
"version": "1.0.0-B.19",
"version": "1.0.0-B.20",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

2
package.json

@ -1,6 +1,6 @@
{
"name": "vue_cli_ts",
"version": "1.0.0-B.19",
"version": "1.0.0-B.20",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",

4
src/App.vue

@ -38,8 +38,8 @@ onMounted(() => {
_getCustomerList()
timer = setInterval(() => {
_getCustomerList()
scrollList.value?.start()
}, 60000 * 5)
scrollList.value?.scrollTo(0, 1000, false)
}, 1000 * 60)
})
onBeforeUnmount(() => {
clearInterval(timer)

20
src/components/ScrollList/ScrollList.vue

@ -4,7 +4,6 @@
<Swiper
v-if="chunkList.length"
rewind
:autoplay="chunkList.length > 1 ? { delay: 15000 } : false"
observer
observe-parents
observe-slide-children
@ -28,7 +27,7 @@
</template>
<script setup lang="ts">
import { ref, computed, onMounted, onBeforeUnmount } from 'vue'
import { shallowRef, computed, onMounted, onBeforeUnmount } from 'vue'
import { chunk } from 'lodash-es'
import ScrollListItem from '@/components/ScrollListItem/ScrollListItem.vue'
import SwiperCore, { Autoplay } from 'swiper'
@ -51,27 +50,14 @@ const props = withDefaults(defineProps<Props>(), {
const chunkList = computed(() => chunk(props.customerList, 6))
const swiper = ref()
const swiper = shallowRef()
function swiperInit(_swiper: any) {
swiper.value = _swiper
}
function start() {
swiper.value?.autoplay?.start()
}
function stop() {
swiper.value?.autoplay?.stop()
}
onMounted(() => {
window.addEventListener('touchend', stop)
})
onBeforeUnmount(() => {
window.removeEventListener('touchend', stop)
})
defineExpose({
start
swiper
})
</script>

Loading…
Cancel
Save