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 export the default value in <setup>, the import will report an error #2472

Closed
hairyf opened this issue Nov 16, 2020 · 1 comment
Closed

Comments

@hairyf
Copy link

hairyf commented Nov 16, 2020

HelloWorld.vue

<script setup="props" lang="ts">
import { computed, ref, watchEffect } from "vue";
declare const props: {
  msg: string;
};
export const count = ref(0);
export const computedMsg = computed(() => props.msg + "!!!!");
watchEffect(() => {
  console.log(computedMsg.value);
});
</script>

App.vue

<script lang="ts">
import { defineComponent } from "vue";
// error: Module ....../HelloWorld.vue has no default export.
import HelloWorld from "@/components/HelloWorld.vue";

export default defineComponent({
  name: "Home",
  components: {
    HelloWorld
  }
});
</script>
@yoyo930021
Copy link
Member

Duplicate of #2296

@yoyo930021 yoyo930021 marked this as a duplicate of #2296 Nov 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants