Skip to content

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

Open
@xjArea

Description

@xjArea

使用 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions