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

No render BaklavaJS V2 #221

Closed
EugineKh opened this issue Nov 10, 2022 · 2 comments
Closed

No render BaklavaJS V2 #221

EugineKh opened this issue Nov 10, 2022 · 2 comments

Comments

@EugineKh
Copy link

EugineKh commented Nov 10, 2022

Hello.
I'm trying to use BaklavaJS V2 but nothing is displayed on the page and there are no errors in the console either.

Create project:

npm create vite@latest testproject
✔ Package name: … testproject
✔ Select a framework: › Vue
✔ Select a variant: › JavaScript

cd testproject
npm install

npm i baklavajs@next

I am using only one file App.vue

<script setup>
import { EditorComponent, useBaklava } from "@baklavajs/renderer-vue"
import { defineNode, NodeInterface, NumberInterface, SelectInterface } from "baklavajs"
import "@baklavajs/themes/dist/syrup-dark.css"

const baklava = useBaklava()
const TestNode = defineNode({
  title: "TestNode",
  inputs: {
    number1: () => new NumberInterface("Number", 1),
    number2: () => new NumberInterface("Number", 10),
    operation: () => new SelectInterface("Operation", "Add", ["Add", "Subtract"]).setPort(false),
  },
  outputs: {
    output: () => new NodeInterface("Output", 0),
  }
})
baklava.editor.registerNodeType(TestNode)
</script>

<template>
<div>Some text before</div>
<EditorComponent :view-model="baklava" />
<div>Some text after</div><br>
</template>

<style scoped>
</style>
@EugineKh
Copy link
Author

EugineKh commented Nov 10, 2022

I figured out what's going on:
in the <template> section, you must specify the component inside another <div> with the dimensions.
For example:

<template>
<div style="height: 100vh; width: 100vw">
     <EditorComponent :view-model="baklava" />
</div>
</template>

The sample in documentation for baklavajs V2 only states:

<template>
    <baklava-editor :view-model="baklava" />
</template>

@EugineKh EugineKh changed the title No render No render BaklavaJS V2 Nov 10, 2022
@newcat
Copy link
Owner

newcat commented Nov 11, 2022

Thanks, I have added this information to the documentation. It will be published together with the next beta release

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