NCKU CCEP 115 YeyeLeaf
在Vue3 CompositionAPI的寫法分為<script>(+setup)和<script setup>
<script>
<script>
import { ref } from 'vue'
export default {
setup() {
const count = ref(1)
const increaseCount = () => {
count.value++
}
return {
count,
increase
}
}
}
</script>
<script setup>
<script setup>
import { ref } from 'vue'
const count = ref(1)
const increaseCount = () => {
count.value++
}
</script>
import { ref, reactive } from 'vue'
reactive()
ref()
@
display
屬性v-show
v-if
v-for="item in items"
v-for="(item, index) in items"