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

[Vue]addRelative is not a function #39

Open
kaikaihha opened this issue Mar 23, 2024 · 1 comment
Open

[Vue]addRelative is not a function #39

kaikaihha opened this issue Mar 23, 2024 · 1 comment

Comments

@kaikaihha
Copy link

Hello,I tried to import this proj on examples/create-tree/,but I found it didn't work in some cases in my Vue proj.

First,pencil and add icon didn't appear,so i found it miss some params: 'cardEditForm' and 'addRelative'.But I don't know what the parameters consists of.How should I write two arguments?

Thank you ! :)

const store = await f3.createStore({
        data: await data(),
        node_separation: 250,
        level_separation: 150,
      }),
      view = f3.d3AnimationView({
        store,
        cont: document.querySelector("#FamilyChart"),
      }),
      Card = f3.elements.Card({
        store,
        svg: view.svg,
        card_dim: {
          w: 220,
          h: 70,
          text_x: 75,
          text_y: 15,
          img_w: 60,
          img_h: 60,
          img_x: 5,
          img_y: 5,
        },
        card_display: [
          (d) => `${d.data["first_name"] || ""} ${d.data["last_name"] || ""}`,
          (d) => `${d.data["birthday"] || ""}`,
        ],
        mini_tree: true,
        link_break: false,
        // cardEditForm: () => {}, ??
        // addRelative: () => {}, ??
      });

    view.setCard(Card);
    store.setOnUpdate((props) => view.update(props || {}));
    store.update.tree({ initial: true });
@kaikaihha
Copy link
Author

kaikaihha commented Mar 29, 2024

I finnaly find out what 'cardEditForm' and 'addRelative' I should pass.But it happened when elements were clicked:"Cannot read properties of null (reading 'jquery')" at below code:

// at index
M.Modal.init(modal, {}); 

// at Function.getInstance (materialize-css.js)
       {
          key: "getInstance",
          value: function getInstance(el) {
            var domElem = !!el.jquery ? el[0] : el;
            return domElem.M_Modal;
          }
        }

Why does 'el' has 'jquery' property?
I appreciate your time!(:

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

1 participant