triniwiz / nativescript-image-zoom

Apache License 2.0
19 stars 14 forks source link

Does it possible to use this plugin with NativeScript-Vue? #21

Open asologor opened 5 years ago

asologor commented 5 years ago

Any examples?

What I've tried:

import Vue from 'nativescript-vue';
import { ImageZoom } from 'nativescript-image-zoom';

Vue.component('ImageZoom', ImageZoom);
<template>
  <Page class="page" backgroundSpanUnderStatusBar="true" @loaded="loadPhoto" backgroundColor="#222222">
    <GridLayout rows="*">
      <StackLayout row="0" verticalAlign="center">
        <ImageZoom src="res://testimg" maxZoom="3" minZoom="1" width="400" height="400" backgroundColor="#77d94b" />
      </StackLayout>
    </GridLayout>
  </Page>
</template>

It does not crash, but it renders nothing. Works fine if I change <ImageZoom ... /> to just <Image ... /> with the same attrs.

P.S.: it doesn't crash on iOS, but on Android the app crashes on startup.

asologor commented 5 years ago

For now, we decided to use WebView with <img src="..." /> tag inside. It gives us native zoom ability.

romanran commented 4 years ago

Vue.registerElement('ImageZoom', () => require('nativescript-image-zoom').ImageZoom) Works fine

sandwai-scottjackman commented 3 years ago

Same issue here - and I have registered the element as per instructions. On Android I can't load the TabView containing the ImageZoom element. There is no error, but nothing happens. If I change to an Image element, everything works fine (apart from no zoom obviously).

Might have to look at using WebView instead.