mirror of
https://github.com/vform666/variant-form3-vite.git
synced 2025-01-10 08:09:13 +08:00
解决Vue.Draggable在Vue新版3.2.32上运行报错“Cannot set properties of null (setting '__draggable_context')”的问题。
This commit is contained in:
parent
18870a2d95
commit
b9e861d8f7
37
lib/vuedraggable/dist/vuedraggable.common.js
vendored
37
lib/vuedraggable/dist/vuedraggable.common.js
vendored
@ -4259,7 +4259,7 @@ function insertNodeAt(fatherNode, node, position) {
|
|||||||
|
|
||||||
|
|
||||||
// EXTERNAL MODULE: ./src/util/console.js
|
// EXTERNAL MODULE: ./src/util/console.js
|
||||||
var console = __webpack_require__("dbf1");
|
var util_console = __webpack_require__("dbf1");
|
||||||
|
|
||||||
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.reduce.js
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.reduce.js
|
||||||
var es_array_reduce = __webpack_require__("13d5");
|
var es_array_reduce = __webpack_require__("13d5");
|
||||||
@ -4460,9 +4460,15 @@ function _createClass(Constructor, protoProps, staticProps) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
var getHtmlElementFromNode = function getHtmlElementFromNode(_ref) {
|
//const getHtmlElementFromNode = ({ el }) => el;
|
||||||
var el = _ref.el;
|
var getHtmlElementFromNode = function getHtmlElementFromNode(node) {
|
||||||
return el;
|
var el = node.el || Array.isArray(node.children) && node.children[0].el.parentNode;
|
||||||
|
|
||||||
|
if (!el) {
|
||||||
|
console.error("使用 transition-group , 需要在slot中template内至少2层html标签");
|
||||||
|
}
|
||||||
|
|
||||||
|
return el || {};
|
||||||
};
|
};
|
||||||
|
|
||||||
var addContext = function addContext(domElement, context) {
|
var addContext = function addContext(domElement, context) {
|
||||||
@ -4474,13 +4480,13 @@ var getContext = function getContext(domElement) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
var componentStructure_ComponentStructure = /*#__PURE__*/function () {
|
var componentStructure_ComponentStructure = /*#__PURE__*/function () {
|
||||||
function ComponentStructure(_ref2) {
|
function ComponentStructure(_ref) {
|
||||||
var _ref2$nodes = _ref2.nodes,
|
var _ref$nodes = _ref.nodes,
|
||||||
header = _ref2$nodes.header,
|
header = _ref$nodes.header,
|
||||||
defaultNodes = _ref2$nodes.default,
|
defaultNodes = _ref$nodes.default,
|
||||||
footer = _ref2$nodes.footer,
|
footer = _ref$nodes.footer,
|
||||||
root = _ref2.root,
|
root = _ref.root,
|
||||||
realList = _ref2.realList;
|
realList = _ref.realList;
|
||||||
|
|
||||||
_classCallCheck(this, ComponentStructure);
|
_classCallCheck(this, ComponentStructure);
|
||||||
|
|
||||||
@ -4783,7 +4789,7 @@ var draggableComponent = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["d
|
|||||||
},
|
},
|
||||||
created: function created() {
|
created: function created() {
|
||||||
if (this.list !== null && this.modelValue !== null) {
|
if (this.list !== null && this.modelValue !== null) {
|
||||||
console["a" /* console */].error("modelValue and list props are mutually exclusive! Please set one or another.");
|
util_console["a" /* console */].error("modelValue and list props are mutually exclusive! Please set one or another.");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted: function mounted() {
|
mounted: function mounted() {
|
||||||
@ -4884,6 +4890,7 @@ var draggableComponent = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["d
|
|||||||
spliceList: function spliceList() {
|
spliceList: function spliceList() {
|
||||||
var _arguments = arguments;
|
var _arguments = arguments;
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
var spliceList = function spliceList(list) {
|
var spliceList = function spliceList(list) {
|
||||||
return list.splice.apply(list, _toConsumableArray(_arguments));
|
return list.splice.apply(list, _toConsumableArray(_arguments));
|
||||||
};
|
};
|
||||||
@ -4937,7 +4944,8 @@ var draggableComponent = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["d
|
|||||||
}
|
}
|
||||||
|
|
||||||
removeNode(evt.item);
|
removeNode(evt.item);
|
||||||
var newIndex = this.getVmIndexFromDomIndex(evt.newIndex);
|
var newIndex = this.getVmIndexFromDomIndex(evt.newIndex); // @ts-ignore
|
||||||
|
|
||||||
this.spliceList(newIndex, 0, element);
|
this.spliceList(newIndex, 0, element);
|
||||||
var added = {
|
var added = {
|
||||||
element: element,
|
element: element,
|
||||||
@ -4958,7 +4966,8 @@ var draggableComponent = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["d
|
|||||||
|
|
||||||
var _this$context = this.context,
|
var _this$context = this.context,
|
||||||
oldIndex = _this$context.index,
|
oldIndex = _this$context.index,
|
||||||
element = _this$context.element;
|
element = _this$context.element; // @ts-ignore
|
||||||
|
|
||||||
this.spliceList(oldIndex, 1);
|
this.spliceList(oldIndex, 1);
|
||||||
var removed = {
|
var removed = {
|
||||||
element: element,
|
element: element,
|
||||||
|
File diff suppressed because one or more lines are too long
37
lib/vuedraggable/dist/vuedraggable.umd.js
vendored
37
lib/vuedraggable/dist/vuedraggable.umd.js
vendored
@ -4268,7 +4268,7 @@ function insertNodeAt(fatherNode, node, position) {
|
|||||||
|
|
||||||
|
|
||||||
// EXTERNAL MODULE: ./src/util/console.js
|
// EXTERNAL MODULE: ./src/util/console.js
|
||||||
var console = __webpack_require__("dbf1");
|
var util_console = __webpack_require__("dbf1");
|
||||||
|
|
||||||
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.reduce.js
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.reduce.js
|
||||||
var es_array_reduce = __webpack_require__("13d5");
|
var es_array_reduce = __webpack_require__("13d5");
|
||||||
@ -4469,9 +4469,15 @@ function _createClass(Constructor, protoProps, staticProps) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
var getHtmlElementFromNode = function getHtmlElementFromNode(_ref) {
|
//const getHtmlElementFromNode = ({ el }) => el;
|
||||||
var el = _ref.el;
|
var getHtmlElementFromNode = function getHtmlElementFromNode(node) {
|
||||||
return el;
|
var el = node.el || Array.isArray(node.children) && node.children[0].el.parentNode;
|
||||||
|
|
||||||
|
if (!el) {
|
||||||
|
console.error("使用 transition-group , 需要在slot中template内至少2层html标签");
|
||||||
|
}
|
||||||
|
|
||||||
|
return el || {};
|
||||||
};
|
};
|
||||||
|
|
||||||
var addContext = function addContext(domElement, context) {
|
var addContext = function addContext(domElement, context) {
|
||||||
@ -4483,13 +4489,13 @@ var getContext = function getContext(domElement) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
var componentStructure_ComponentStructure = /*#__PURE__*/function () {
|
var componentStructure_ComponentStructure = /*#__PURE__*/function () {
|
||||||
function ComponentStructure(_ref2) {
|
function ComponentStructure(_ref) {
|
||||||
var _ref2$nodes = _ref2.nodes,
|
var _ref$nodes = _ref.nodes,
|
||||||
header = _ref2$nodes.header,
|
header = _ref$nodes.header,
|
||||||
defaultNodes = _ref2$nodes.default,
|
defaultNodes = _ref$nodes.default,
|
||||||
footer = _ref2$nodes.footer,
|
footer = _ref$nodes.footer,
|
||||||
root = _ref2.root,
|
root = _ref.root,
|
||||||
realList = _ref2.realList;
|
realList = _ref.realList;
|
||||||
|
|
||||||
_classCallCheck(this, ComponentStructure);
|
_classCallCheck(this, ComponentStructure);
|
||||||
|
|
||||||
@ -4792,7 +4798,7 @@ var draggableComponent = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["d
|
|||||||
},
|
},
|
||||||
created: function created() {
|
created: function created() {
|
||||||
if (this.list !== null && this.modelValue !== null) {
|
if (this.list !== null && this.modelValue !== null) {
|
||||||
console["a" /* console */].error("modelValue and list props are mutually exclusive! Please set one or another.");
|
util_console["a" /* console */].error("modelValue and list props are mutually exclusive! Please set one or another.");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted: function mounted() {
|
mounted: function mounted() {
|
||||||
@ -4893,6 +4899,7 @@ var draggableComponent = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["d
|
|||||||
spliceList: function spliceList() {
|
spliceList: function spliceList() {
|
||||||
var _arguments = arguments;
|
var _arguments = arguments;
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
var spliceList = function spliceList(list) {
|
var spliceList = function spliceList(list) {
|
||||||
return list.splice.apply(list, _toConsumableArray(_arguments));
|
return list.splice.apply(list, _toConsumableArray(_arguments));
|
||||||
};
|
};
|
||||||
@ -4946,7 +4953,8 @@ var draggableComponent = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["d
|
|||||||
}
|
}
|
||||||
|
|
||||||
removeNode(evt.item);
|
removeNode(evt.item);
|
||||||
var newIndex = this.getVmIndexFromDomIndex(evt.newIndex);
|
var newIndex = this.getVmIndexFromDomIndex(evt.newIndex); // @ts-ignore
|
||||||
|
|
||||||
this.spliceList(newIndex, 0, element);
|
this.spliceList(newIndex, 0, element);
|
||||||
var added = {
|
var added = {
|
||||||
element: element,
|
element: element,
|
||||||
@ -4967,7 +4975,8 @@ var draggableComponent = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["d
|
|||||||
|
|
||||||
var _this$context = this.context,
|
var _this$context = this.context,
|
||||||
oldIndex = _this$context.index,
|
oldIndex = _this$context.index,
|
||||||
element = _this$context.element;
|
element = _this$context.element; // @ts-ignore
|
||||||
|
|
||||||
this.spliceList(oldIndex, 1);
|
this.spliceList(oldIndex, 1);
|
||||||
var removed = {
|
var removed = {
|
||||||
element: element,
|
element: element,
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -18,7 +18,7 @@
|
|||||||
"file-saver": "^2.0.5",
|
"file-saver": "^2.0.5",
|
||||||
"mitt": "^3.0.0",
|
"mitt": "^3.0.0",
|
||||||
"sortablejs": "1.14.0",
|
"sortablejs": "1.14.0",
|
||||||
"vue": "3.2.26",
|
"vue": "^3.2.32",
|
||||||
"vue3-quill": "^0.2.6"
|
"vue3-quill": "^0.2.6"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
tag="transition-group" :component-data="{name: 'fade'}"
|
tag="transition-group" :component-data="{name: 'fade'}"
|
||||||
handle=".drag-handler" @end="onDragEnd" @add="onDragAdd" @update="onDragUpdate" :move="checkMove">
|
handle=".drag-handler" @end="onDragEnd" @add="onDragAdd" @update="onDragUpdate" :move="checkMove">
|
||||||
<template #item="{ element: widget, index }">
|
<template #item="{ element: widget, index }">
|
||||||
|
<div class="transition-group-el">
|
||||||
<template v-if="'container' === widget.category">
|
<template v-if="'container' === widget.category">
|
||||||
<component :is="getWidgetName(widget)" :widget="widget" :designer="designer" :key="widget.id" :parent-list="designer.widgetList"
|
<component :is="getWidgetName(widget)" :widget="widget" :designer="designer" :key="widget.id" :parent-list="designer.widgetList"
|
||||||
:index-of-parent-list="index" :parent-widget="null"></component>
|
:index-of-parent-list="index" :parent-widget="null"></component>
|
||||||
@ -21,6 +22,7 @@
|
|||||||
<component :is="getWidgetName(widget)" :field="widget" :designer="designer" :key="widget.id" :parent-list="designer.widgetList"
|
<component :is="getWidgetName(widget)" :field="widget" :designer="designer" :key="widget.id" :parent-list="designer.widgetList"
|
||||||
:index-of-parent-list="index" :parent-widget="null" :design-state="true"></component>
|
:index-of-parent-list="index" :parent-widget="null" :design-state="true"></component>
|
||||||
</template>
|
</template>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</draggable>
|
</draggable>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user