Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
asologor opened this issue Jul 2, 2019 · 3 comments
Open

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

asologor opened this issue Jul 2, 2019 · 3 comments

Comments

@asologor
Copy link

asologor commented Jul 2, 2019

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
Copy link
Author

asologor commented Jul 3, 2019

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

@romanran
Copy link

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

@ghost
Copy link

ghost commented Dec 8, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants