摘要: 01、index.ts路由代码如下: //创建路由并暴露出去 import {createRouter, createWebHistory} from 'vue-router' import Home from '@/view/Home.vue' import About from '@/view/ 阅读全文
posted @ 2024-08-18 23:06 像一棵海草海草海草 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 01、main.js代码如下: // 引入createApp用于创建Vue实例 import {createApp} from 'vue' // 引入App.vue根组件 import App from './App.vue' //引入路由 import router from './router' 阅读全文
posted @ 2024-08-18 22:36 像一棵海草海草海草 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 01、在main.js中引入路由并使用路由,代码如下: // 引入createApp用于创建Vue实例 import {createApp} from 'vue' // 引入App.vue根组件 import App from './App.vue' //引入路由 import router fro 阅读全文
posted @ 2024-08-18 18:08 像一棵海草海草海草 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 01、在view中创建myhook文件夹,并创建2个文件。usesDog.ts代码如下: import {onMounted, reactive} from "vue"; import axios from "axios"; export default function () { // 抓取图片 阅读全文
posted @ 2024-08-18 17:07 像一棵海草海草海草 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 01、App.vue代码如下: <template> <div class="app"> <h2>App.Vue</h2> <Person/> </div> </template> <script lang="ts" setup name="App"> // JS或TS import Person 阅读全文
posted @ 2024-08-18 16:28 像一棵海草海草海草 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 1、App.vue代码如下: <template> <div class="app"> <h2>App.Vue</h2> <Person v-if="isShow"/> <button @click="isShow =!isShow">点我切换</button> </div> </template> 阅读全文
posted @ 2024-08-18 15:44 像一棵海草海草海草 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 01、index.ts代码如下: // 定义一个接口,用于限制person对象的具体属性 export interface PersonInter { id: string; name: string; age: number; } export type Persons = Array<Perso 阅读全文
posted @ 2024-08-18 14:02 像一棵海草海草海草 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 01、index.js代码如下: // 定义一个接口,用于限制person对象的具体属性 export interface PersonInter { id: string; name: string; age: number; } export type Persons = Array<Perso 阅读全文
posted @ 2024-08-18 13:57 像一棵海草海草海草 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 01、新建一个index.ts文件,代码如下: // 定义一个接口,用于限制person对象的具体属性 export interface PersonInter { id: string; name: string; age: number; } export type Persons = Arra 阅读全文
posted @ 2024-08-18 13:19 像一棵海草海草海草 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 01、App.vue代码如下: <template> <div class="app"> <h2>{{ title }}</h2> <!-- 使用了ref来获取子组件的属性--> <Person/> </div> </template> <script lang="ts" setup name="A 阅读全文
posted @ 2024-08-18 12:35 像一棵海草海草海草 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 01、App.vue代码如下: <template> <div class="app"> <h2>{{ title }}</h2> <!-- 使用了ref来获取子组件的属性--> <Person/> </div> </template> <script lang="ts" setup name="A 阅读全文
posted @ 2024-08-18 12:17 像一棵海草海草海草 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 1、App.vue代码如下: <template> <div class="app"> <h2>{{ title }}</h2> <!-- 使用了ref来获取子组件的属性--> <Person/> </div> </template> <script lang="ts" setup name="Ap 阅读全文
posted @ 2024-08-18 12:08 像一棵海草海草海草 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 01、App.vue代码如下: <template> <div class="app"> <h2>{{ title }}</h2> <!-- 使用了ref来获取子组件的属性--> <Person/> </div> </template> <script lang="ts" setup name="A 阅读全文
posted @ 2024-08-18 02:13 像一棵海草海草海草 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 1、App.vue代码如下: <template> <div class="app"> <h2>{{ title }}</h2> <!-- 使用了ref来获取子组件的属性--> <Person/> </div> </template> <script lang="ts" setup name="Ap 阅读全文
posted @ 2024-08-18 01:58 像一棵海草海草海草 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 01、App.vue代码如下: <template> <div class="app"> <h2>{{ title }}</h2> <!-- 使用了ref来获取子组件的属性--> <Person/> </div> </template> <script lang="ts" setup name="A 阅读全文
posted @ 2024-08-18 00:14 像一棵海草海草海草 阅读(5) 评论(0) 推荐(0) 编辑
摘要: 01、App.vue代码如下: <template> <div class="app"> <h2>{{ title }}</h2> <!-- 使用了ref来获取子组件的属性--> <Person/> </div> </template> <script lang="ts" setup name="A 阅读全文
posted @ 2024-08-18 00:07 像一棵海草海草海草 阅读(2) 评论(0) 推荐(0) 编辑