Subscribe on changes!

Using v-model on <input> in client-oriented render function in SSR doesn't work if type attribute is dynamic

avatar
Apr 22nd 2022

Version

3.2.33

Reproduction link

stackblitz.com

Steps to reproduce

  1. In a component template, use an <input> that has a dynamic type attribute and uses v-model: <input :type="foo" v-model="bar">
  2. Compile this component to a client-oriented render function
  3. Use this compiled component in an SSR app, passing in { foo: 'text', bar: 'hello' }

What is expected?

The input should render as <input type="text" value="hello">

What is actually happening?

The input renders without a value: <input type="text">


This happens because vModelDynamic in src/directives/vModel.ts doesn't have an SSR equivalent, even though it would be possible to implement one.