| 12345678910111213141516171819 |
- <template>
- <div>
- <h1>Demo6--标签Ref</h1>
- <h3 ref="weather">今天天气真好</h3>
- <button @click="showMain">输出</button>
- </div>
- </template>
- <script lang="ts" setup>
- import {ref,reactive} from "vue"
- let weather = ref(111);
- console.log(weather.value,'初始化',weather)
- function showMain() {
- console.log(weather.value,'输出')
- }
- </script>
- <style lang="scss" scoped>
- </style>
|