Xarviel gdzie ta appka ma kod z vue 2?
Praktycznie w każdym komponencie, w którym jest logika
https://github.com/inconcessus21/Winorosl/blob/main/QueryHex3/QueryHex/src/views/PreDashboard.vue
https://github.com/inconcessus21/Winorosl/blob/main/QueryHex3/QueryHex/src/views/DetailView.vue
https://github.com/inconcessus21/Winorosl/blob/main/QueryHex3/QueryHex/src/views/ProfileView.vue
https://github.com/inconcessus21/Winorosl/blob/main/QueryHex3/QueryHex/src/components/ProfileView/AboutMeAndSkills.vue
https://github.com/inconcessus21/Winorosl/blob/main/QueryHex3/QueryHex/src/components/ProfileView/EditAvatar.vue
itd :D :P
Spójrz na przykładzie tego komponentu (https://github.com/inconcessus21/Winorosl/blob/main/QueryHex3/QueryHex/src/views/DetailView.vue)
<script>
import '...';
// ...
export default {
name: 'DetailView',
data() {
// ...
},
setup() {
// ...
},
components: {
// ...
},
mounted() {
// ...
},
props: {
// ...
},
computed: {
// ...
},
}
</script>
bo niby wykorzystujesz funkcję setup
(która ma jedynie 2 linijki), ale pomijasz pozostałe elementy z nowego composition api
<script setup>
import { ref, defineProps, onMounted } from 'vue';
// ...
// components
import { Swiper, SwiperSlide } from "swiper/vue";
import Comments from '../components/DetailView/Comments.vue'
// data
const project = ref([]);
// ...
const addTask = ref({
id: "",
title: "",
description: "",
planningDate: "",
isDone: false,
errors: []
});
// props
const props = defineProps({
uuid: String
});
// mounted
onMounted(() => {
// ...
});
// computed
const isValidAddTask = computed(() => {
// ...
});
const isManager = computed(() => {
// ...
})
const managerList = computed(() => {
// ...
});
// methods
const clearTasks = () => {
addTask.value.isDone = false
addTask.value.title = "";
addTask.value.description = "";
addTask.value.planningDate = "";
}
const calcDate = (date) => moment(date).format('YYYY-DD-MM');
// ...
</script>
według mnie jest dość spora różnica pomiędzy tymi dwoma zapisami