Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ssr): render initial selected properly #9442

Merged
merged 5 commits into from
Oct 20, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(ssr): render initial selected properly
edison1105 committed Oct 20, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 10a3bf23c24efcc16b5d61e8538519da2986742c
2 changes: 1 addition & 1 deletion packages/compiler-ssr/src/transforms/ssrVModel.ts
Original file line number Diff line number Diff line change
@@ -131,7 +131,7 @@ export const ssrTransformModel: DirectiveTransform = (dir, node, context) => {
node.children = [createInterpolation(model, model.loc)]
} else if (node.tag === 'select') {
node.children.forEach(option => {
if (option.type === NodeTypes.ELEMENT && option.tag === 'options') {
if (option.type === NodeTypes.ELEMENT && option.tag === 'option') {
const plainNode = option as PlainElementNode
if (plainNode.props.findIndex(p => p.name === 'selected') === -1) {
const value = findValueBinding(plainNode)