Error in mounted hook: "TypeError: Class constructor Node cannot be invoked without 'new'"
Error in mounted hook: "TypeError: Class constructor Node cannot be invoked without 'new'"
错误
[Vue warn]: Error in mounted hook: "TypeError: Class constructor Node cannot be invoked without 'new'"
app.vue
<template>
<v-container>
<tiptap-vuetify
v-model="content"
:extensions="extensions" />
</v-container>
</template>
<script>
// import the component and the necessary extensions
import { TiptapVuetify, Heading, Bold, Italic, Strike, Underline, Code, Paragraph, BulletList, OrderedList, ListItem, Link, Blockquote, HardBreak, HorizontalRule, History ,TodoList,TodoItem} from 'tiptap-vuetify'
export default {
// specify TiptapVuetify component in "components"
components: { TiptapVuetify },
data: () => ({
content: `
<h3>TIPTAP</h3>`,
// declare extensions you want to use
extensions: [
History,
Blockquote,
Link,
Underline,
Strike,
Italic,
ListItem,
BulletList,
OrderedList,
[Heading, {
options: {
levels: [1, 2, 3]
}
}],
Bold,
Code,
HorizontalRule,
Paragraph,
HardBreak,
TodoList,
[TodoItem, {
options: {nested: true}
}],],
}),}
</script>
系统信息
- OS: Windows10
- 版本 Node.js:v14.15.1
依赖关系
- "core-js": "^3.6.5",
- "tiptap-vuetify": "^2.24.0",
- "vue": "^2.6.11",
- "vuetify": "^2.2.11"
回购
我认为您可以执行以下操作来强制 tiptap 进行转译。
# vue.config.js
transpileDependencies: [
/[\/]node_modules[\/]tiptap.*/
],
我们收到此错误的原因是因为我们尝试使用转译的 class.
扩展本机 class
参考文献:
错误
[Vue warn]: Error in mounted hook: "TypeError: Class constructor Node cannot be invoked without 'new'"
app.vue
<template>
<v-container>
<tiptap-vuetify
v-model="content"
:extensions="extensions" />
</v-container>
</template>
<script>
// import the component and the necessary extensions
import { TiptapVuetify, Heading, Bold, Italic, Strike, Underline, Code, Paragraph, BulletList, OrderedList, ListItem, Link, Blockquote, HardBreak, HorizontalRule, History ,TodoList,TodoItem} from 'tiptap-vuetify'
export default {
// specify TiptapVuetify component in "components"
components: { TiptapVuetify },
data: () => ({
content: `
<h3>TIPTAP</h3>`,
// declare extensions you want to use
extensions: [
History,
Blockquote,
Link,
Underline,
Strike,
Italic,
ListItem,
BulletList,
OrderedList,
[Heading, {
options: {
levels: [1, 2, 3]
}
}],
Bold,
Code,
HorizontalRule,
Paragraph,
HardBreak,
TodoList,
[TodoItem, {
options: {nested: true}
}],],
}),}
</script>
系统信息
- OS: Windows10
- 版本 Node.js:v14.15.1
依赖关系
- "core-js": "^3.6.5",
- "tiptap-vuetify": "^2.24.0",
- "vue": "^2.6.11",
- "vuetify": "^2.2.11"
回购
我认为您可以执行以下操作来强制 tiptap 进行转译。
# vue.config.js
transpileDependencies: [
/[\/]node_modules[\/]tiptap.*/
],
我们收到此错误的原因是因为我们尝试使用转译的 class.
扩展本机 class参考文献: