nativescript-community / ui-canvas

Implement Canvas into your NativeScript apps.
https://nativescript-community.github.io/ui-canvas/
Apache License 2.0
31 stars 9 forks source link

Could not load view for: nativecanvasview #24

Closed luiguild closed 3 years ago

luiguild commented 3 years ago

Make sure to check the demo app(s) for sample usage

Done

Make sure to check the existing issues in this repository

Done

If the demo apps cannot help and there is no issue for your problem, tell us about it

Please, ensure your title is less than 63 characters long and starts with a capital letter.

Which platform(s) does your issue occur on?

Please, provide the following version numbers that your issue occurs with:

Please, tell us how to recreate the issue in as much detail as possible.

Describe the steps to reproduce it. (JS Project) Import plugin on main:

import CanvasPlugin from '@nativescript-community/ui-canvas/vue'
Vue.use(CanvasPlugin)

Create a clean page on project:

<template lang="pug">
Page(
  actionBarHidden="true"
)
  GridLayout(
    rows="*",
    columns="*"
  )
    CanvasView(width="100" height="100" @draw="draw")
</template>

import: (need add this on doc also)

import { Color } from '@nativescript/core'
import { Paint, createRect } from '@nativescript-community/ui-canvas'

create method:

draw ({ canvas }) {
      const paint = new Paint()
      paint.setColor(new Color('black'))
      paint.strokeWidth = 10
      canvas.drawRect(createRect(0, 0, 200, 100), paint)
}

error

 {NSVue (Vue: 2.6.11 | NSVue: 2.7.1)} -> CreateElement(canvasview)
JS: TypeError: Could not load view for: nativecanvasview. TypeError: _nativescript_core__WEBPACK_IMPORTED_MODULE_0__.Property is not a constructor TypeError: _nativescript_core__WEBPACK_IMPORTED_MODULE_0__.Property is not a constructor
JS:     at Module.../node_modules/@nativescript-community/ui-canvas/canvas.common.js (file: src\src\canvas.common.ts:21:30)
farfromrefug commented 3 years ago

@luiguild it does not support N 6.x! Sorry had to make a clean break.

luiguild commented 3 years ago

Ok, no problem, thanks for your quickly response!

farfromrefug commented 3 years ago

@luiguild btw there is https://www.npmjs.com/package/nativescript-canvas which still works with 6.x but i dont really update it anymore :s