jerosoler / Drawflow

Simple flow library 🖥️🖱️
https://jerosoler.github.io/Drawflow/
MIT License
4.65k stars 722 forks source link

issue when using with vue3 cli & typescript #219

Closed gago8910 closed 2 years ago

gago8910 commented 3 years ago

I using drawflow version 0.0.46[

Screen Shot 2021-07-28 at 22 50 03

](url)

jerosoler commented 3 years ago

Have you imported vue?

import * as Vue from 'vue'
gago8910 commented 3 years ago

Have you imported vue?

import * as Vue from 'vue'

yes, i already imported vue. This is my code:

<template>
  <div id="drawflow"></div>
</template>

<script lang="ts">
import { defineComponent, onMounted } from 'vue'
import Drawflow from 'drawflow'
import 'drawflow/dist/drawflow.min.css'
import * as Vue from 'vue'
export default defineComponent({
  name: 'BotFlowsIndex',
  setup () {
    onMounted(() => {
      const id = document.getElementById('drawflow') as HTMLElement
      const editor = new Drawflow(id, Vue)
      editor.start()
    })
  }
})
</script>
jerosoler commented 3 years ago

View example of vue3 https://github.com/jerosoler/Drawflow/issues/100

gago8910 commented 3 years ago

@jerosoler thanks for answer. I have used vue component but got the error same here. Have you updated how to fix this on vue3?

I have a look at the source code library @type/drawflow at constructor function, params number (1) does not match with js version (3)

jerosoler commented 2 years ago

Sorry for not answering, I would miss it.

@type/drawflow is external ( not maintainer ) View other example with vue3 with new version 0.0.50 https://github.com/jerosoler/Drawflow/issues/274#issuecomment-946454633