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

does it works well with vue3? #156

Open
bokeer opened this issue Jan 17, 2021 · 4 comments
Open

does it works well with vue3? #156

bokeer opened this issue Jan 17, 2021 · 4 comments

Comments

@bokeer
Copy link

bokeer commented Jan 17, 2021

Uncaught TypeError: h is not a function

@mustafam-globant
Copy link

From Docs-
In 3.x, h is now globally imported instead of being automatically passed as an argument.
https://v3.vuejs.org/guide/migration/render-function-api.html#render-function-argument

Implementing this in MonacoEditor.js solved the issue for me.

@Ph0enixKM
Copy link

Ph0enixKM commented Apr 2, 2021

Yes, you just have to write this line under MonacoEditor import:

MonacoEditor.render = () => h('div')

@IOSDongba
Copy link

2.x语法
在2.x中,该render函数将自动接收该h函数(这是的常规别名createElement)作为参数:

// Vue 2 Render Function Example
export default {
render(h) {
return h('div')
}
}
#3.x语法
在3.x中,h现在已全局导入,而不是自动作为参数传递。

// Vue 3 Render Function Example
import { h } from 'vue'

export default {
render() {
return h('div')
}
}

@mike-seekwell
Copy link

mike-seekwell commented Aug 31, 2021

import MonacoEditor from 'vue-monaco'
import { h } from 'vue'
MonacoEditor.render = () => h('div')

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

5 participants