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

Slot v-bind broken in v0.34 #1156

Closed
Uninen opened this issue Apr 10, 2022 · 2 comments
Closed

Slot v-bind broken in v0.34 #1156

Uninen opened this issue Apr 10, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@Uninen
Copy link

Uninen commented Apr 10, 2022

The latest version seems to break slots v-bind (not a single file seems to work with this code, where everything worked fine before) in VSCode.

For example:

<script setup lang="ts">
import { inject, ref } from 'vue'
import { TableState } from './types'

const state = inject('state') as TableState

const data = ref(state.data.current)
</script>
<template>
  <slot
    v-bind="{
      data,
    }"
  ></slot>
</template>

Results in No value exists in scope for the shorthand property 'data'. Either declare one or provide an initializer.

I'm seeing this with all of my code using Volar 0.34.2 and VSCode 1.66.1.

These issues are unfortunate as there is no way to downgrade the version after automatic upgrade and installing a specific version seems not to work:

~ code --install-extension johnsoncodehk.volar@0.33.12
Installing extensions...
Updating the extension 'johnsoncodehk.volar' to the version 0.33.12
Installing extension 'johnsoncodehk.volar' v0.33.12...
Can't install release version of 'johnsoncodehk.volar' extension because it has no release version.
Failed Installing Extensions: johnsoncodehk.volar
@johnsoncodehk johnsoncodehk added the bug Something isn't working label Apr 10, 2022
@johnsoncodehk
Copy link
Member

Thanks for the report! You could use v-bind="{ data: data }" instead of v-bind="{ data }" for now.

@Uninen
Copy link
Author

Uninen commented Apr 10, 2022

Indeed, v-bind="{ data: data }" seems to work 👍 Will need a ton of updates to code but at least there's a workaround.

Thanks for the swift reply 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants