Skip to content

Data binding to SVG properties throws error #61

@rmeshksar

Description

@rmeshksar

Hi,
I am new to SlimJs and trying to use the data binding for some SVG attributes.

Slim.tag(
	'maze-board',
	`<svg class="maze-grid" bind:width="maxWidth" bind:height="maxHeight"></svg>`,
	class MazeBoard extends Slim {
		onBeforeCreated() {
			this.maxWidth = 1000;
			this.maxHeight = 1000;
		}
	});

But I a m getting the following error:

Slim.js:990 Uncaught TypeError: Cannot assign to read only property 'width' of object '#'
at Slim.js:990
at Function.commit (Slim.js:386)
at Function.commit (Slim.js:414)
at HTMLElement._executeBindings (Slim.js:528)
at doRender (Slim.js:647)

Am I doing something wrong here?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions