mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(ImagePreview): failed to drag image
This commit is contained in:
parent
6ab2b3bf1f
commit
ea846033f7
@ -70,7 +70,6 @@ export default createComponent({
|
|||||||
emits: ['scale', 'close', 'closed', 'change', 'update:show'],
|
emits: ['scale', 'close', 'closed', 'change', 'update:show'],
|
||||||
|
|
||||||
setup(props, { emit, slots }) {
|
setup(props, { emit, slots }) {
|
||||||
const rootRef = ref();
|
|
||||||
const swipeRef = ref();
|
const swipeRef = ref();
|
||||||
|
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
@ -80,9 +79,8 @@ export default createComponent({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const resize = () => {
|
const resize = () => {
|
||||||
const root = rootRef.value;
|
if (swipeRef.value) {
|
||||||
if (root && root.getBoundingClientRect) {
|
const rect = swipeRef.value.$el.getBoundingClientRect();
|
||||||
const rect = root.getBoundingClientRect();
|
|
||||||
state.rootWidth = rect.width;
|
state.rootWidth = rect.width;
|
||||||
state.rootHeight = rect.height;
|
state.rootHeight = rect.height;
|
||||||
}
|
}
|
||||||
@ -207,7 +205,6 @@ export default createComponent({
|
|||||||
|
|
||||||
return () => (
|
return () => (
|
||||||
<Popup
|
<Popup
|
||||||
ref={rootRef}
|
|
||||||
show={props.show}
|
show={props.show}
|
||||||
class={[bem(), props.className]}
|
class={[bem(), props.className]}
|
||||||
overlayClass={bem('overlay')}
|
overlayClass={bem('overlay')}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user