@@ -122,8 +122,13 @@ export const ssrTransformElement: NodeTransform = (node, context) => {
122122 | InterpolationNode
123123 | undefined
124124 // If interpolation, this is dynamic <textarea> content, potentially
125- // injected by v-model and takes higher priority than v-bind value
126- if ( ! existingText || existingText . type !== NodeTypes . INTERPOLATION ) {
125+ // injected by v-model and takes higher priority than v-bind value.
126+ // Additionally, directives with content overrides (v-text/v-html)
127+ // have higher priority than the merged props.
128+ if (
129+ ! hasContentOverrideDirective ( node ) &&
130+ ( ! existingText || existingText . type !== NodeTypes . INTERPOLATION )
131+ ) {
127132 // <textarea> with dynamic v-bind. We don't know if the final props
128133 // will contain .value, so we will have to do something special:
129134 // assign the merged props to a temp variable, and check whether
@@ -176,9 +181,8 @@ export const ssrTransformElement: NodeTransform = (node, context) => {
176181 ]
177182 }
178183 } else if ( directives . length && ! node . children . length ) {
179- // v-text directive has higher priority than the merged props
180- const vText = findDir ( node , 'text' )
181- if ( ! vText ) {
184+ // v-text/v-html have higher priority than the merged props
185+ if ( ! hasContentOverrideDirective ( node ) ) {
182186 const tempId = `_temp${ context . temps ++ } `
183187 propsExp . arguments = [
184188 createAssignmentExpression (
@@ -449,6 +453,10 @@ function findVModel(node: PlainElementNode): DirectiveNode | undefined {
449453 ) as DirectiveNode | undefined
450454}
451455
456+ function hasContentOverrideDirective ( node : PlainElementNode ) : boolean {
457+ return ! ! findDir ( node , 'text' ) || ! ! findDir ( node , 'html' )
458+ }
459+
452460export function ssrProcessElement (
453461 node : PlainElementNode ,
454462 context : SSRTransformContext ,
0 commit comments