4/5/1404
This commit is contained in:
+16
-14
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @vue/compiler-ssr v3.5.18
|
||||
* @vue/compiler-ssr v3.5.14
|
||||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||||
* @license MIT
|
||||
**/
|
||||
@@ -1086,17 +1086,6 @@ const ssrTransformModel = (dir, node, context) => {
|
||||
);
|
||||
}
|
||||
}
|
||||
const processSelectChildren = (children) => {
|
||||
children.forEach((child) => {
|
||||
if (child.type === 1) {
|
||||
processOption(child);
|
||||
} else if (child.type === 11) {
|
||||
processSelectChildren(child.children);
|
||||
} else if (child.type === 9) {
|
||||
child.branches.forEach((b) => processSelectChildren(b.children));
|
||||
}
|
||||
});
|
||||
};
|
||||
function processOption(plainNode) {
|
||||
if (plainNode.tag === "option") {
|
||||
if (plainNode.props.findIndex((p) => p.name === "selected") === -1) {
|
||||
@@ -1123,7 +1112,9 @@ const ssrTransformModel = (dir, node, context) => {
|
||||
);
|
||||
}
|
||||
} else if (plainNode.tag === "optgroup") {
|
||||
processSelectChildren(plainNode.children);
|
||||
plainNode.children.forEach(
|
||||
(option) => processOption(option)
|
||||
);
|
||||
}
|
||||
}
|
||||
if (node.tagType === 0) {
|
||||
@@ -1208,7 +1199,18 @@ const ssrTransformModel = (dir, node, context) => {
|
||||
checkDuplicatedValue();
|
||||
node.children = [compilerDom.createInterpolation(model, model.loc)];
|
||||
} else if (node.tag === "select") {
|
||||
processSelectChildren(node.children);
|
||||
const processChildren = (children) => {
|
||||
children.forEach((child) => {
|
||||
if (child.type === 1) {
|
||||
processOption(child);
|
||||
} else if (child.type === 11) {
|
||||
processChildren(child.children);
|
||||
} else if (child.type === 9) {
|
||||
child.branches.forEach((b) => processChildren(b.children));
|
||||
}
|
||||
});
|
||||
};
|
||||
processChildren(node.children);
|
||||
} else {
|
||||
context.onError(
|
||||
compilerDom.createDOMCompilerError(
|
||||
|
||||
Reference in New Issue
Block a user