作业:作业上传
This commit is contained in:
15
3.22作业/Vue3Proj/vue-project/src/Com3_3.vue
Normal file
15
3.22作业/Vue3Proj/vue-project/src/Com3_3.vue
Normal file
@@ -0,0 +1,15 @@
|
||||
<template>
|
||||
<h3 v-if="flag">条件为{{flag}}时,渲染‘这是v-if’</h3>
|
||||
<h3 v-show="flag">条件为{{flag}}时,渲染h3-这是v-show</h3>
|
||||
<div v-show="flag" class="div1">div</div>
|
||||
<button type="button" @click="change">切换元素-{{flag}}</button>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {ref } from "vue";
|
||||
|
||||
const flag = ref(true)
|
||||
const change = ()=>{
|
||||
flag.value = !flag.value
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user