Vue 3 Composition API: script setup ve Ref
Vue 3'ün Composition API'si, mantığı Options API'den daha esnek bir şekilde düzenlemeye izin verir. Kod yazımı daha kısa, mantık gruplaması daha net olur. Options API'den Composition API'ye <!-- Options API --> <script> export default { data() { return { sayi: 0, liste: [] }; }, computed: { ciftSayi() { return this.sayi * 2; } }, methods: { artir() { this.sayi++; } }, } </script> <!-- Composition API --> <script setup> import { ref, computed } from 'vue'; const sayi = ref(0); const liste =…