1、使用onMounted等必须声明
import { onMounted } from ‘vue’;
2、data中简单数据使用ref
const XX=ref(XX)
3、methods中的方法直接改为function,注意使用数据需要.value (选项式中是this.)
4、无需return data和methods了
5、子组件在父组件中也无需声明了,导致组件名字根据文件名推测,如果需要显式说明,可以写两个<script>标签,丑但是有效
<script>
export default {
name: 'demo'
}
</script>
<script setup>
// do something...
</script>