Closed Nobilta closed 1 year ago
你的 webacpk 无法处理 ?.
,配一下 babel loader,include 加上 @guolao/vue-monaco-editor
。
fixed in version@1.1.1
Suport to es2017 now.
fixed in version@1.1.1
Suport to es2017 now.
确实修复了这个问题 但是demo中的CreateApp()在vue2.6.14中似乎并不支持(引入App.vue后使用New Vue()似乎也无效),控制台提示:
TypeError: Object(...) is not a function
createApp
从@vue/composition-api
中导出,API 不熟的话可以去看下文档。也可以看下这个 例子
非常感谢,完美解决问题
I also have trouble getting this to work with vue 2.6.14
In my main.ts I have imported vue-composition api
import VueCompositionAPI from '@vue/composition-api'
Vue.use(VueCompositionAPI)
And then I have a simple editor component
<div style="height: 100%;">
<Editor
height="80vh"
theme="vs-dark"
/>
</div>
</template>
<script lang="ts">
import { defineComponent, ref, computed } from '@vue/composition-api'
import Editor from '@guolao/vue-monaco-editor'
export default defineComponent({
components: { Editor },
setup () {
}
})
</script>
However I am getting TypeError: Object(...) is not a function
error.
I've tried to add monaco-vue
to transpile-dependencies
in vue.config.js but it did not work.
Using webpack btw.
I am not able to reproduce it.
Can you provide a gihub repository that reproduce this issue? @apertureless
vue版本 2.6.14,已安装@vue/composition-api,在单页引入后报错