|
@@ -1,7 +1,13 @@
|
|
|
<script setup>
|
|
|
import { ref, onMounted, computed } from 'vue'
|
|
|
|
|
|
+import { useRoute } from 'vue-router'
|
|
|
+
|
|
|
const props = defineProps({
|
|
|
+ idx: {
|
|
|
+ type: String,
|
|
|
+ default: "-1",
|
|
|
+ },
|
|
|
direction: {
|
|
|
type: String,
|
|
|
default: "横",
|
|
@@ -16,6 +22,8 @@ const props = defineProps({
|
|
|
}
|
|
|
})
|
|
|
|
|
|
+const route = useRoute()
|
|
|
+
|
|
|
const isRow = computed(() => {
|
|
|
return props.direction
|
|
|
})
|
|
@@ -61,6 +69,7 @@ const mousemoveFu = (e, flag) => {
|
|
|
onMounted(() => {
|
|
|
const element = document.querySelector('#myElement')
|
|
|
|
|
|
+
|
|
|
const resizeObserver = new ResizeObserver(entries => {
|
|
|
for (let entry of entries) {
|
|
|
console.log(`Width changed to ${entry.contentRect.width}`)
|
|
@@ -73,7 +82,7 @@ onMounted(() => {
|
|
|
setTimeout(() => {
|
|
|
if (isRow.value === "竖") {
|
|
|
const dom = document.querySelector(".imgBox")
|
|
|
- if (dom && dom.offsetHeight > pageHeightWindow) {
|
|
|
+ if (dom && ( dom.offsetHeight > pageHeightWindow)) {
|
|
|
isMove.value = true
|
|
|
imgWidth.value = dom.offsetWidth
|
|
|
imgHeight.value = dom.offsetHeight
|
|
@@ -83,13 +92,13 @@ onMounted(() => {
|
|
|
const leftBoxWidthDomWidth = leftBoxWidthDom.offsetWidth
|
|
|
leftBoxWidth.value = leftBoxWidthDomWidth
|
|
|
const dom = document.querySelector(".imgBoxHH")
|
|
|
- if ( dom && dom.offsetWidth > leftBoxWidthDomWidth) {
|
|
|
+ if (dom && (dom.offsetWidth > leftBoxWidthDomWidth)) {
|
|
|
isMove.value = true
|
|
|
imgWidth.value = dom.offsetWidth
|
|
|
imgHeight.value = dom.offsetHeight
|
|
|
}
|
|
|
}
|
|
|
- }, 200)
|
|
|
+ }, 700)
|
|
|
tiemrr.value = setInterval(() => {
|
|
|
if (zhouMove.value >= 99) clearInterval(tiemrr.value)
|
|
|
zhouMove.value = zhouMove.value + 1
|
|
@@ -133,7 +142,8 @@ onMounted(() => {
|
|
|
v-if="isRow === '竖'"
|
|
|
:class="`imgBox ${isMove ? '' : 'imgBoxMove'}`"
|
|
|
:style="`clip-path: rect(0 100% ${zhouMove}% 0);
|
|
|
- transform: translateY(${moveLoc}px)
|
|
|
+ transform: translateY(${moveLoc}px);
|
|
|
+ padding: ${route.query.idx == '17' ? '25% 3% 8% 3%' :route.query.idx == '19' ? '28% 3% 9% 3%': route.query.idx == '11' ? '20% 3% 7% 3%': route.query.idx == '4' ? '24% 3% 8% 3%': route.query.idx == '9' ? '17% 3% 6% 3%': ''}
|
|
|
`"
|
|
|
@mousedown="isFlag = true"
|
|
|
@mouseup="isFlag = false"
|