摘要:
01、index.ts路由代码如下: //创建路由并暴露出去 import {createRouter, createWebHistory} from 'vue-router' import Home from '@/view/Home.vue' import About from '@/view/ 阅读全文
摘要:
01、main.js代码如下: // 引入createApp用于创建Vue实例 import {createApp} from 'vue' // 引入App.vue根组件 import App from './App.vue' //引入路由 import router from './router' 阅读全文
摘要:
01、在main.js中引入路由并使用路由,代码如下: // 引入createApp用于创建Vue实例 import {createApp} from 'vue' // 引入App.vue根组件 import App from './App.vue' //引入路由 import router fro 阅读全文
摘要:
01、在view中创建myhook文件夹,并创建2个文件。usesDog.ts代码如下: import {onMounted, reactive} from "vue"; import axios from "axios"; export default function () { // 抓取图片 阅读全文
摘要:
01、App.vue代码如下: <template> <div class="app"> <h2>App.Vue</h2> <Person/> </div> </template> <script lang="ts" setup name="App"> // JS或TS import Person 阅读全文
摘要:
1、App.vue代码如下: <template> <div class="app"> <h2>App.Vue</h2> <Person v-if="isShow"/> <button @click="isShow =!isShow">点我切换</button> </div> </template> 阅读全文
摘要:
01、index.ts代码如下: // 定义一个接口,用于限制person对象的具体属性 export interface PersonInter { id: string; name: string; age: number; } export type Persons = Array<Perso 阅读全文
摘要:
01、index.js代码如下: // 定义一个接口,用于限制person对象的具体属性 export interface PersonInter { id: string; name: string; age: number; } export type Persons = Array<Perso 阅读全文
摘要:
01、新建一个index.ts文件,代码如下: // 定义一个接口,用于限制person对象的具体属性 export interface PersonInter { id: string; name: string; age: number; } export type Persons = Arra 阅读全文
摘要:
01、App.vue代码如下: <template> <div class="app"> <h2>{{ title }}</h2> <!-- 使用了ref来获取子组件的属性--> <Person/> </div> </template> <script lang="ts" setup name="A 阅读全文
摘要:
01、App.vue代码如下: <template> <div class="app"> <h2>{{ title }}</h2> <!-- 使用了ref来获取子组件的属性--> <Person/> </div> </template> <script lang="ts" setup name="A 阅读全文
摘要:
1、App.vue代码如下: <template> <div class="app"> <h2>{{ title }}</h2> <!-- 使用了ref来获取子组件的属性--> <Person/> </div> </template> <script lang="ts" setup name="Ap 阅读全文
摘要:
01、App.vue代码如下: <template> <div class="app"> <h2>{{ title }}</h2> <!-- 使用了ref来获取子组件的属性--> <Person/> </div> </template> <script lang="ts" setup name="A 阅读全文
摘要:
1、App.vue代码如下: <template> <div class="app"> <h2>{{ title }}</h2> <!-- 使用了ref来获取子组件的属性--> <Person/> </div> </template> <script lang="ts" setup name="Ap 阅读全文
摘要:
01、App.vue代码如下: <template> <div class="app"> <h2>{{ title }}</h2> <!-- 使用了ref来获取子组件的属性--> <Person/> </div> </template> <script lang="ts" setup name="A 阅读全文
摘要:
01、App.vue代码如下: <template> <div class="app"> <h2>{{ title }}</h2> <!-- 使用了ref来获取子组件的属性--> <Person/> </div> </template> <script lang="ts" setup name="A 阅读全文