Subscribe on changes!

<script>options api与<script setup>一起使用时,v-model生产模式构建错误

avatar
Jul 12th 2022

Vue version

3.2.27

Link to minimal reproduction

https://sfc.vuejs.org/#eNqFUttu2zAM/RVCGNAWSKx2fRjgOUE67DP04lpMrdWWBIl2NwT591GWk9TpsAKGZN4OqcNzEE/eF+OAohRVbILxtFXW9N4Fgp+m7tzLk9awD66Hm0KePank5ruyAMri7ylb474eOoJD8jaOISxaiiUc3gEdVymqa6pv73ImQEAagj1ZALF1b5ybi0rY113EqQzgmC4++KvkeVw28j9EhvLsaZyNBC12nYMNPNzf86jLAsLedzUhWwDV80DkLOyazjSvGyUWI2woDKjEdhoMKpmTc+HlZeO6dxq7MiVdIygBkvMree4qViKTvO5rX/yKzvICJgbUHIhKMHX52Uow3clWoiXysZRysP71pWCa5Y5jMgyWTI9r7frdY/G1ePwmtYn03l9g7NfPwb1FDNxRiZnTCVyyc8SwDmg1Bgz/bXaVu2h4FfvQ9LRAJmAhpoX+/qUoHxzPcmIk0ZuURX88lvDDuQ5ruzpVzKKZ1ZbPHql1+oLQGo0XDQJQa2LxBXtDt0oMniWK0y6Zp4x294kEl4rSZmRJmP0sBZbPtFyq2oetnh4OtdaVZDPjftBgGpDL0rXUHBM9Xqnp+BdUJ0lC

Steps to reproduce

  1. 点击 show 按钮
  2. 点击 hide 按钮
  3. 出现错误提示 showAddDialog is not defined

What is expected?

生产模式能与开发模式保持一直,能正确构建出 v-model 的语法糖代码。

What is actually happening?

生产模式能构建出了错误的代码,

//....
{
    show: e.showDialogAdd,
    "onUpdate:show": s[1] || (s[1] = u=>B(showDialogAdd) ? showDialogAdd.value = u : null),
    roles: e.adminRoles,
    onAfterAdd: e.onSubmit  
}
//....

System Info

No response

Any additional comments?

No response

avatar
Jul 12th 2022

duplicate of #6248