nativescript-community / nativescript-community/ui-canvas

canvas undefined

Open
#16 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
38
Forks
9
PR merge metrics
No merged PRs in 30d

Description

where is this problem. I am using Vue

html
`<CanvasView col="0" row="0" width="100" height="300" @draw="draw" />`
JS:
`import {
  Canvas,
  Cap,
  createRect,
  createRectF,
  Paint,
  Style
} from "nativescript-canvas";
import { Color } from "@nativescript/core/color/color";`

`methods: {
    draw({ canvas }) {
      const paint = new Paint();
      paint.setColor(new Color("black"));
      paint.strokeWidth = 10;
      canvas.drawRect(createRect(0, 0, 200, 100), paint);
    }
  }`

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Vue template's CanvasView and the draw({ canvas }) callback, using the imports and example shown in the issue. Reproduce the example in a NativeScript app and determine why canvas is undefined; done means the cause and a verified correction or clear reproduction details are recorded.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.