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

Not working with script setup #5

Closed
ChangJoo-Park opened this issue Jan 27, 2021 · 1 comment
Closed

Not working with script setup #5

ChangJoo-Park opened this issue Jan 27, 2021 · 1 comment

Comments

@ChangJoo-Park
Copy link

Hello @loonpwn , I use vue-cli-plugin-import-components on Vue.js 3, It works nice.

I try to use script setup, but It is not working.

my script setup code here.

<script setup>
import { ref } from "vue"
export const text = ref('')
</script>

Can you test this with your plugin?

@harlan-zw
Copy link
Owner

Hi @ChangJoo-Park

I had a play with the setup api at example/vue3 project (see https://github.com/loonpwn/vue-cli-plugin-import-components/pull/6/files) and wasn't able to replicate your issue, the component imports seem to be working correctly.

I think your problem be related to the code you have pasted, the latest setup syntax is that you shouldn't be exporting any values. So your code should look like this:

<script setup>
import { ref } from "vue"
const text = ref('')
</script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants