Giter Site home page Giter Site logo

Comments (4)

newcat avatar newcat commented on May 22, 2024

Yes there is. Every option component receives some props, one of them being the node instance. Example:

module.exports = {
    props: ["node"],
    methods: {
        onClick() {
            this.node.state.counter++;
        }
    }
}

Admittedly, the documentation is not very good at the moment. I actually reworked the documentation about node options a few days ago, but apparently it is still not clear. Maybe I should add some code examples like the one above. Would that help?

from baklavajs.

RingoKam avatar RingoKam commented on May 22, 2024

Awesome! Thanks for the quick reply.

As far as the doc goes, having the project written in typescript definitely help me navigate the library and understand what each part does. More code example would definitely helped.

How about adding code sandbox to the doc?

Setting up based on https://newcat.github.io/baklavajs/#/plugins/view
https://codesandbox.io/s/baklavajs-setup-zvevk

Creating a customNode:
https://codesandbox.io/s/baklavajs-customnode-i0lzl

Some unrelated questions:
If I want to have more granular control over the node component, let say I want to change the template of the node itself, is extending the Node.vue component is the way to go?

from baklavajs.

newcat avatar newcat commented on May 22, 2024

I really like the code sandbox idea and will definetely implement that.

Yes you can "extend" the node component. Unfortunately, extending in Vue is not really possible, so you have to copy the source code and modify the copy. Have a look here (hope it helps πŸ˜‰): https://newcat.github.io/baklavajs/#/styling?id=hardcore-customization

from baklavajs.

RingoKam avatar RingoKam commented on May 22, 2024

yup thats what i needed! thank you πŸ™‡β€β™‚οΈ

closing this issue.

from baklavajs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.