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

无法处理 <script setup></script> 的情况 ? #4

Open
xjArea opened this issue Jul 6, 2023 · 0 comments · May be fixed by #5
Open

无法处理 <script setup></script> 的情况 ? #4

xjArea opened this issue Jul 6, 2023 · 0 comments · May be fixed by #5

Comments

@xjArea
Copy link

xjArea commented Jul 6, 2023

使用 setup 的写法, Demo 就会报错了, 好像这种代码会被放到 scriptSetup 属性中, 而不是 script 里面 ?

<noscript type="vue-sfc" component="MyComponent" mount="#app">
<script setup>
	import {ref, } from 'vue';
	let count = ref(0);
</script>

<template>
	<button @click="count++">Count is: {{ count }}</button>
</template>

<style scoped>
	button {font-weight: bold;}
</style>
</noscript>

<div id="app"></div>
<script src="https://unpkg.com/noscript-sfc/index.js"></script>
# 错误信息
vue.esm-browser.js:1513 [Vue warn]: Cannot mutate <script setup> binding "count" from Options API.
AngusFu pushed a commit to AngusFu/vue-sfc-in-html that referenced this issue Jul 27, 2024
AngusFu added a commit to AngusFu/vue-sfc-in-html that referenced this issue Jul 27, 2024
@AngusFu AngusFu linked a pull request Jul 27, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant