Skip to content

Commit 2cb08d3

Browse files
max-nextcloudbdbch
andauthored
fix(drag-handle-vue-2): fix vue2 warnign about objects as default (#6857)
* fix(drag-handle-vue-2): use factory function for default Vue2 requires factory functions for defaults for objects and arrays. Prevent the warning > Invalid default value for prop "PluginKey": Props with type Object/Array must use a factory function to return the default value. Signed-off-by: Max <max@nextcloud.com> * Fix prop default handling for Vue 2 --------- Signed-off-by: Max <max@nextcloud.com> Co-authored-by: bdbch <6538827+bdbch@users.noreply.github.com>
1 parent d3773c7 commit 2cb08d3

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

.changeset/moody-trees-rescue.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tiptap/extension-drag-handle-vue-2': patch
3+
---
4+
5+
Use factory function for object default value as required by vue 2.

.changeset/serious-tools-hear.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@tiptap/extension-drag-handle-vue-2": patch
3+
---
4+
5+
Fixed a bug that would cause Vue 2 to throw errors in console because Vue 2 expects factory functions for prop defaults

packages/extension-drag-handle-vue-2/src/DragHandle.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const DragHandle = Vue.extend({
2020
props: {
2121
pluginKey: {
2222
type: [String, Object] as PropType<DragHandleProps['pluginKey']>,
23-
default: dragHandlePluginDefaultKey,
23+
default: () => dragHandlePluginDefaultKey,
2424
},
2525

2626
editor: {

0 commit comments

Comments
 (0)