save
This commit is contained in:
parent
4847d1a59e
commit
8a8e258a20
@ -1,5 +1,5 @@
|
||||
<script setup lang="jsx">
|
||||
import {computed, createApp, onMounted, reactive, ref, watch} from "vue";
|
||||
import {computed, createApp, h, onMounted, reactive, ref, render, watch} from "vue";
|
||||
import GM from '../../utils'
|
||||
import {getSlideDistance, slideInit, slideReset, slideTouchEnd, slideTouchMove, slideTouchStart} from "./common";
|
||||
import {SlideType} from "@/utils/const_var";
|
||||
@ -93,7 +93,8 @@ watch(
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
watch(
|
||||
() => props.index,
|
||||
@ -113,7 +114,8 @@ watch(
|
||||
type: EVENT_KEY.ITEM_STOP
|
||||
})
|
||||
}, 200)
|
||||
},)
|
||||
}
|
||||
)
|
||||
|
||||
watch(
|
||||
() => props.active,
|
||||
@ -130,7 +132,9 @@ watch(
|
||||
index: state.localIndex,
|
||||
type: newVal === false ? EVENT_KEY.ITEM_STOP : EVENT_KEY.ITEM_PLAY
|
||||
})
|
||||
}, {immediate: true})
|
||||
},
|
||||
{immediate: true}
|
||||
)
|
||||
|
||||
onMounted(() => {
|
||||
slideInit(wrapperEl.value, state, SlideType.VERTICAL)
|
||||
@ -186,16 +190,25 @@ defineExpose({dislike})
|
||||
function getInsEl(item, index, play = false) {
|
||||
// console.log('index', index, play)
|
||||
let slideVNode = props.render(item, index, play, props.uniqueId)
|
||||
const app = createApp({
|
||||
render() {
|
||||
return <SlideItem data-index={index}>{slideVNode}</SlideItem>
|
||||
const parent = document.createElement('div')
|
||||
parent.classList.add('slide-item')
|
||||
parent.setAttribute('data-index', index)
|
||||
render(slideVNode, parent)
|
||||
// const app = createApp({
|
||||
// render() {
|
||||
// return <SlideItem data-index={index}>{slideVNode}</SlideItem>
|
||||
// }
|
||||
// })
|
||||
// const ins = app.mount(parent)
|
||||
// appInsMap.set(index, ins)
|
||||
// return ins.$el
|
||||
appInsMap.set(index, {
|
||||
unmount: () => {
|
||||
render(null, parent)
|
||||
parent.remove()
|
||||
}
|
||||
})
|
||||
const parent = document.createElement('div')
|
||||
const ins = app.mount(parent)
|
||||
appInsMap.set(index, app)
|
||||
// this.appInsMap.set(index, ins)
|
||||
return ins.$el
|
||||
return parent
|
||||
}
|
||||
|
||||
function touchStart(e) {
|
||||
|
||||
@ -20,7 +20,6 @@
|
||||
|
||||
import {reactive} from "vue";
|
||||
import {useNav} from "@/utils/hooks/useNav";
|
||||
import InfiniteList from "@/pages/slideHooks/InfiniteList.vue";
|
||||
import api from "@/api";
|
||||
import SlideList from "@/pages/home/slide/SlideList.vue";
|
||||
|
||||
|
||||
@ -55,12 +55,10 @@
|
||||
|
||||
<script setup lang="jsx">
|
||||
import SlideItem from '@/components/slide/SlideItem.vue'
|
||||
import {onMounted, onUnmounted, reactive, ref, watch} from "vue";
|
||||
import {onMounted, onUnmounted, reactive, ref} from "vue";
|
||||
import bus, {EVENT_KEY} from "@/utils/bus";
|
||||
import Utils from "@/utils";
|
||||
import api from "@/api";
|
||||
import Loading from "@/components/Loading.vue";
|
||||
import {useSlideListItemRender} from "@/utils/hooks/useSlideListItemRender";
|
||||
import SlideList from './SlideList.vue';
|
||||
|
||||
const props = defineProps({
|
||||
|
||||
@ -25,12 +25,10 @@
|
||||
|
||||
<script setup lang="jsx">
|
||||
import SlideItem from '@/components/slide/SlideItem.vue'
|
||||
import {onMounted, onUnmounted, reactive, ref, watch} from "vue";
|
||||
import {onMounted, onUnmounted, reactive, ref} from "vue";
|
||||
import bus, {EVENT_KEY} from "@/utils/bus";
|
||||
import Utils from "@/utils";
|
||||
import api from "@/api";
|
||||
import Loading from "@/components/Loading.vue";
|
||||
import {useSlideListItemRender} from "@/utils/hooks/useSlideListItemRender";
|
||||
import SlideList from './SlideList.vue';
|
||||
|
||||
const props = defineProps({
|
||||
|
||||
@ -3,7 +3,6 @@ import BaseHeader from "../components/BaseHeader";
|
||||
import SlideList from "../components/slide/SlideList";
|
||||
import SlideRowList from "../components/slide/SlideRowList";
|
||||
import SlideColumnList from "../components/slide/SlideColumnList";
|
||||
import SlideColumnVirtualList from "../components/slide/SlideColumnVirtualList";
|
||||
import SlideItem from "../components/slide/SlideItem";
|
||||
import Indicator from "../components/slide/Indicator";
|
||||
import Video from "../components/Video";
|
||||
@ -24,7 +23,6 @@ export default {
|
||||
SlideList,
|
||||
SlideRowList,
|
||||
SlideColumnList,
|
||||
SlideColumnVirtualList,
|
||||
SlideItem,
|
||||
Indicator,
|
||||
'Video1': Video,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user