Vue3新特性與最佳實踐總結(jié)與開發(fā)技巧
前言
在 Vue 3 的開發(fā)旅程中,掌握一系列最佳實踐和技巧至關(guān)重要。這些實踐和技巧不僅能提升開發(fā)效率,還能確保應(yīng)用的性能、可維護性和用戶體驗達到最佳狀態(tài)。本文將深入探討 Vue 3 開發(fā)中的關(guān)鍵實踐和技巧,幫助開發(fā)者在項目中充分發(fā)揮 Vue 3 的優(yōu)勢。
一、項目結(jié)構(gòu)與配置
(一)項目結(jié)構(gòu)
一個清晰的項目結(jié)構(gòu)是成功開發(fā)的基礎(chǔ)。推薦采用以下結(jié)構(gòu):
src/ ├── assets/ # 靜態(tài)資源 ├── components/ # 組件 ├── composables/ # 可復用邏輯 ├── hooks/ # 自定義鉤子 ├── layouts/ # 布局 ├── router/ # 路由配置 ├── stores/ # 狀態(tài)管理 ├── utils/ # 工具函數(shù) ├── views/ # 頁面組件 ├── App.vue # 根組件 ├── main.js # 入口文件 ├── env.d.ts # 環(huán)境聲明 ├── vite.config.ts # 構(gòu)建配置 ├── tsconfig.json # TypeScript 配置 ├── package.json # 項目依賴 └── .eslintrc.js # ESLint 配置
(二)構(gòu)建配置
使用 Vite 進行構(gòu)建配置,確保開發(fā)和生產(chǎn)環(huán)境的高效性。
// vite.config.ts
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import path from 'path';
export default defineConfig({
plugins: [vue()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
server: {
port: 3000,
open: true,
},
build: {
target: 'es2020',
minify: 'terser',
terserOptions: {
compress: {
drop_console: true,
},
},
},
});
二、Composition API 的使用
(一)邏輯復用
通過 composables 文件夾組織可復用邏輯。
// composables/useCounter.js
import { ref, computed } from 'vue';
export function useCounter() {
const count = ref(0);
const doubleCount = computed(() => count.value * 2);
function increment() {
count.value++;
}
return { count, doubleCount, increment };
}
// 在組件中使用
<script setup>
import { useCounter } from '@/composables/useCounter';
const { count, doubleCount, increment } = useCounter();
</script>
<template>
<div>
<h1>{{ count }}</h1>
<p>{{ doubleCount }}</p>
<button @click="increment">Increment</button>
</div>
</template>
(二)類型安全
使用 TypeScript 為 Composition API 提供類型支持。
// composables/useCounter.ts
import { ref, computed } from 'vue';
export interface CounterState {
count: number;
doubleCount: number;
}
export function useCounter() {
const count = ref(0);
const doubleCount = computed(() => count.value * 2);
function increment() {
count.value++;
}
return { count, doubleCount: doubleCount as unknown as number, increment };
}
三、響應(yīng)式系統(tǒng)優(yōu)化
(一)使用shallowReactive和shallowRef
當不需要深層響應(yīng)式處理時,使用 shallowReactive 和 shallowRef 以減少 Proxy 的嵌套代理。
import { shallowReactive } from 'vue';
const state = shallowReactive({
data: {
name: 'Vue 3',
description: 'A progressive JavaScript framework',
},
});
(二)避免不必要的響應(yīng)式操作
僅對需要響應(yīng)式的數(shù)據(jù)使用 ref 和 reactive。
import { ref } from 'vue';
const name = ref('Vue 3');
const description = 'A progressive JavaScript framework';
四、組件設(shè)計與開發(fā)
(一)組件拆分
將復雜組件拆分為多個小組件,提高可維護性和復用性。
<!-- ParentComponent.vue -->
<template>
<div>
<ChildComponent />
</div>
</template>
<script setup>
import ChildComponent from './ChildComponent.vue';
</script>
<!-- ChildComponent.vue -->
<template>
<div>
<h1>{{ title }}</h1>
<p>{{ content }}</p>
</div>
</template>
<script setup>
defineProps({
title: {
type: String,
required: true,
},
content: {
type: String,
required: true,
},
});
</script>
(二)組件緩存
使用 keep-alive 緩存不活動的組件實例。
<template>
<keep-alive include="TabComponent">
<component :is="currentComponent"></component>
</keep-alive>
</template>
<script setup>
import { ref } from 'vue';
import TabComponent from './TabComponent.vue';
const currentComponent = ref('TabComponent');
</script>
五、性能優(yōu)化與監(jiān)控
(一)懶加載
使用 defineAsyncComponent 實現(xiàn)組件的懶加載。
import { defineAsyncComponent } from 'vue';
const AsyncComponent = defineAsyncComponent(() =>
import('./AsyncComponent.vue')
);
(二)性能監(jiān)控
使用 Vue Devtools 和 Lighthouse 進行性能監(jiān)控。
// 在開發(fā)過程中使用 Vue Devtools 監(jiān)控性能 // 在構(gòu)建過程中使用 Lighthouse 進行自動化性能測試
六、國際化與本地化
(一)使用 Vue I18n
配置 Vue I18n 實現(xiàn)多語言支持。
// i18n.js
import { createI18n } from 'vue-i18n';
const i18n = createI18n({
legacy: false,
locale: 'en',
messages: {
en: {
greeting: 'Hello, Vue 3!',
},
zh: {
greeting: '你好,Vue 3!',
},
},
});
export default i18n;
// main.js
import { createApp } from 'vue';
import App from './App.vue';
import i18n from './i18n';
const app = createApp(App);
app.use(i18n);
app.mount('#app');
(二)動態(tài)切換語言
在組件中動態(tài)切換語言。
<template>
<div>
<button @click="changeLanguage('en')">English</button>
<button @click="changeLanguage('zh')">中文</button>
<h1>{{ $t('greeting') }}</h1>
</div>
</template>
<script setup>
import { useI18n } from 'vue-i18n';
const { t, locale } = useI18n();
function changeLanguage(lang) {
locale.value = lang;
}
</script>
七、路由管理
(一)路由懶加載
使用 Vue Router 的懶加載功能。
// router.js
import { createRouter, createWebHistory } from 'vue-router';
const routes = [
{
path: '/',
component: () => import('./views/HomeView.vue'),
},
{
path: '/about',
component: () => import('./views/AboutView.vue'),
},
];
const router = createRouter({
history: createWebHistory(),
routes,
});
export default router;
(二)路由守衛(wèi)
使用路由守衛(wèi)進行權(quán)限控制。
router.beforeEach((to, from, next) => {
if (to.meta.requiresAuth && !isAuthenticated) {
next('/login');
} else {
next();
}
});
八、狀態(tài)管理
(一)使用 Pinia
Pinia 是 Vue 3 的官方狀態(tài)管理庫。
// store.js
import { defineStore } from 'pinia';
export const useCounterStore = defineStore('counter', {
state: () => ({
count: 0,
}),
actions: {
increment() {
this.count++;
},
},
});
// 在組件中使用
<script setup>
import { useCounterStore } from '@/stores/counter';
const counterStore = useCounterStore();
</script>
<template>
<div>
<h1>{{ counterStore.count }}</h1>
<button @click="counterStore.increment">Increment</button>
</div>
</template>
(二)模塊化狀態(tài)管理
將狀態(tài)管理拆分為多個模塊。
// stores/modules/user.js
import { defineStore } from 'pinia';
export const useUserStore = defineStore('user', {
state: () => ({
user: null,
}),
actions: {
setUser(user) {
this.user = user;
},
},
});
// stores/index.js
import { useUserStore } from './modules/user';
export { useUserStore };
九、單元測試與集成測試
(一)使用 Vitest
Vitest 是 Vue 團隊推薦的測試框架。
// counter.test.js
import { describe, it, expect } from 'vitest';
import { useCounter } from '@/composables/useCounter';
describe('useCounter', () => {
it('increments count', () => {
const { count, increment } = useCounter();
increment();
expect(count.value).toBe(1);
});
});
(二)使用 Cypress
Cypress 是一個端到端測試框架。
// test/e2e/specs/homepage.spec.js
describe('Homepage', () => {
it('displays greeting', () => {
cy.visit('/');
cy.contains('Hello, Vue 3!').should('be.visible');
});
});
十、構(gòu)建與部署
(一)使用 Vite 構(gòu)建
Vite 提供了快速的開發(fā)體驗和高效的構(gòu)建過程。
// vite.config.ts
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
export default defineConfig({
plugins: [vue()],
build: {
target: 'es2020',
minify: 'terser',
terserOptions: {
compress: {
drop_console: true,
},
},
},
});
(二)部署到生產(chǎn)環(huán)境
將應(yīng)用部署到生產(chǎn)環(huán)境。
npm run build
十一、開發(fā)工具與插件
(一)Vue Devtools
Vue Devtools 是 Vue 官方提供的瀏覽器擴展,用于調(diào)試 Vue 應(yīng)用。
(二)ESLint 和 Prettier
使用 ESLint 和 Prettier 確保代碼風格一致。
// .eslintrc.js
module.exports = {
extends: ['plugin:vue/vue3-recommended', 'prettier'],
rules: {
'vue/multi-word-component-names': 'off',
},
};
十二、團隊協(xié)作與代碼規(guī)范
(一)代碼審查
實施代碼審查流程,確保代碼質(zhì)量。
(二)Git 工作流
使用 Git Flow 管理項目分支。
# 創(chuàng)建功能分支 git checkout -b feature/new-component # 提交更改 git add . git commit -m 'Add new component' # 合并到開發(fā)分支 git checkout develop git merge feature/new-component git branch -d feature/new-component
十三、持續(xù)集成與持續(xù)部署
(一)GitHub Actions
配置 GitHub Actions 實現(xiàn)自動化構(gòu)建和部署。
# .github/workflows/deploy.yml
name: Deploy
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install dependencies
run: npm install
- name: Build
run: npm run build
- name: Deploy
run: npm run deploy
(二)Netlify
使用 Netlify 部署靜態(tài)網(wǎng)站。
# 安裝 Netlify CLI npm install -g netlify-cli # 登錄 Netlify netlify login # 部署 netlify deploy --prod
十四、安全性最佳實踐
(一)輸入驗證
對用戶輸入進行驗證,防止 XSS 攻擊。
function validateInput(input) {
const regex = /^[a-zA-Z0-9\s]+$/;
return regex.test(input);
}
(二)內(nèi)容安全策略
在 vite.config.ts 中配置 CSP。
// vite.config.ts
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
export default defineConfig({
plugins: [vue()],
server: {
middlewareMode: true,
},
build: {
target: 'es2020',
minify: 'terser',
terserOptions: {
compress: {
drop_console: true,
},
},
},
});
十五、錯誤處理與日志記錄
(一)全局錯誤處理
捕獲全局錯誤并記錄日志。
// main.js
import { createApp } from 'vue';
import App from './App.vue';
import { createLogger } from './logger';
const app = createApp(App);
app.config.errorHandler = (err, vm, info) => {
createLogger().error(`Error in ${info}: ${err.message}`);
};
app.mount('#app');
(二)日志記錄
使用 Winston 進行日志記錄。
// logger.js
import winston from 'winston';
const logger = winston.createLogger({
level: 'info',
format: winston.format.combine(
winston.format.timestamp(),
winston.format.json()
),
transports: [
new winston.transports.File({ filename: 'error.log', level: 'error' }),
new winston.transports.File({ filename: 'combined.log' }),
],
});
if (process.env.NODE_ENV !== 'production') {
logger.add(new winston.transports.Console());
}
export function createLogger() {
return logger;
}
十六、可訪問性(Accessibility)開發(fā)
(一)ARIA 屬性
使用 ARIA 屬性提升可訪問性。
<template>
<button :aria-label="buttonLabel" @click="handleClick">
{{ buttonText }}
</button>
</template>
<script setup>
import { ref } from 'vue';
const buttonText = ref('Click me');
const buttonLabel = ref('Primary action button');
</script>
(二)鍵盤導航
確保組件支持鍵盤導航。
<template>
<div role="tablist">
<div
v-for="(tab, index) in tabs"
:key="index"
role="tab"
:aria-selected="activeTab === index"
@click="activeTab = index"
@keydown.enter.space="activeTab = index"
tabindex="0"
>
{{ tab }}
</div>
</div>
</template>
<script setup>
import { ref } from 'vue';
const tabs = ['Home', 'About', 'Contact'];
const activeTab = ref(0);
</script>
十七、漸進式 Web 應(yīng)用(PWA)開發(fā)
(一)使用 Vite PWA 插件
配置 PWA 支持。
// vite.config.ts
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import { VitePWA } from 'vite-plugin-pwa';
export default defineConfig({
plugins: [
vue(),
VitePWA({
registerType: 'autoUpdate',
includeAssets: ['favicon.ico', 'apple-touch-icon.png'],
manifest: {
name: 'My Vue 3 PWA',
short_name: 'My PWA',
description: 'A progressive web app built with Vue 3',
theme_color: '#ffffff',
icons: [
{
src: 'pwa-192x192.png',
sizes: '192x192',
type: 'image/png',
},
{
src: 'pwa-512x512.png',
sizes: '512x512',
type: 'image/png',
},
],
},
}),
],
});
(二)離線支持
使用 Workbox 配置離線支持。
// service-worker.js
import { precacheAndRoute } from 'workbox-precaching';
import { registerRoute } from 'workbox-routing';
import { CacheFirst } from 'workbox-strategies';
precacheAndRoute(self.__WB_MANIFEST);
registerRoute(
({ request }) => request.mode === 'navigate',
new CacheFirst({
cacheName: 'pages-cache',
plugins: [
new CacheableResponsePlugin({
statuses: [200],
}),
],
})
);
十八、服務(wù)端渲染(SSR)與靜態(tài)生成(SSG)
(一)使用 Nuxt 3
Nuxt 3 是 Vue 3 的官方框架,支持 SSR 和 SSG。
npm create nuxt-app@latest
(二)配置 Nuxt 3 項目
// nuxt.config.ts
export default {
ssr: true,
target: 'static',
nitro: {
preset: 'vercel',
},
};
十九、第三方庫集成
(一)使用 Axios
配置 Axios 進行 HTTP 請求。
// plugins/axios.js
import axios from 'axios';
const api = axios.create({
baseURL: 'https://api.example.com',
});
export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.vueApp.provide('axios', api);
});
(二)使用 Vue Use
Vue Use 提供了許多實用的 Composition API。
// composables/useMouse.js
import { ref } from 'vue';
import { useMouse } from '@vueuse/core';
export function useMouse() {
const { x, y } = useMouse();
return { x, y };
}
// 在組件中使用
<script setup>
import { useMouse } from '@/composables/useMouse';
const { x, y } = useMouse();
</script>
<template>
<div>
Mouse position: {{ x }}, {{ y }}
</div>
</template>
二十、動畫與過渡效果
(一)使用 Vue 過渡
使用 Vue 的 <transition> 組件實現(xiàn)動畫效果。
<template>
<div>
<button @click="show = !show">Toggle</button>
<transition name="fade">
<div v-if="show">Hello, Vue 3!</div>
</transition>
</div>
</template>
<script setup>
import { ref } from 'vue';
const show = ref(true);
</script>
<style>
.fade-enter-active,
.fade-leave-active {
transition: opacity 0.5s;
}
.fade-enter-from,
.fade-leave-to {
opacity: 0;
}
</style>
(二)使用 CSS 動畫庫
使用 CSS 動畫庫(如 Animate.css)增強動畫效果。
<template>
<div>
<button @click="show = !show">Toggle</button>
<transition name="bounce">
<div v-if="show" class="animated">Hello, Vue 3!</div>
</transition>
</div>
</template>
<script setup>
import { ref } from 'vue';
const show = ref(true);
</script>
<style>
@import 'animate.css';
.bounce-enter-active {
animation: bounceIn 0.5s;
}
.bounce-leave-active {
animation: bounceOut 0.5s;
}
</style>
二十一、動態(tài)組件與插件開發(fā)
(一)動態(tài)組件
使用 Vue 的 <component> 標簽實現(xiàn)動態(tài)組件。
<template>
<div>
<button @click="currentComponent = 'Home'">Home</button>
<button @click="currentComponent = 'About'">About</button>
<button @click="currentComponent = 'Contact'">Contact</button>
<component :is="currentComponent"></component>
</div>
</template>
<script setup>
import Home from './components/Home.vue';
import About from './components/About.vue';
import Contact from './components/Contact.vue';
const currentComponent = ref('Home');
</script>
(二)開發(fā)插件
開發(fā)自定義 Vue 插件。
// plugins/my-plugin.js
export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.vueApp.config.globalProperties.$myMethod = function () {
console.log('My plugin method');
};
});
// 在組件中使用
<script setup>
import { onMounted } from 'vue';
onMounted(() => {
console.log(this.$myMethod());
});
</script>
二十二、TypeScript 集成
(一)配置 TypeScript
配置 tsconfig.json 文件。
{
"compilerOptions": {
"target": "ES2020",
"module": "ESNext",
"strict": true,
"jsx": "preserve",
"moduleResolution": "node",
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"types": ["vite/client"]
},
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
"exclude": ["node_modules"]
}
(二)使用 TypeScript
在組件中使用 TypeScript。
<script lang="ts" setup>
import { ref } from 'vue';
const count = ref(0);
const message = ref('Hello, Vue 3!');
const increment = () => {
count.value++;
};
</script>
<template>
<div>
<h1>{{ count }}</h1>
<p>{{ message }}</p>
<button @click="increment">Increment</button>
</div>
</template>
二十三、項目文檔編寫
(一)使用 VitePress
VitePress 是 Vue 團隊提供的文檔站點工具。
npm create vitepress@latest
(二)編寫文檔
在 docs 文件夾中編寫文檔。
# 項目文檔 ## 介紹 本項目是一個基于 Vue 3 的 Web 應(yīng)用。 ## 安裝 ```bash npm install
開發(fā)
npm run dev
構(gòu)建
npm run build
## 二十四、社區(qū)與資源利用 ### (一)參與 Vue 社區(qū) 參與 Vue.js 社區(qū),獲取支持和分享經(jīng)驗。 ### (二)利用官方資源 利用 Vue.js 官方文檔和資源進行學習。 ```bash # 訪問 Vue.js 官方文檔 https://vuejs.org/
二十五、性能優(yōu)化案例分析
(一)案例一:某電商網(wǎng)站的性能優(yōu)化
該電商網(wǎng)站因商品數(shù)據(jù)龐大且頁面交互復雜,首屏加載耗時過長。通過升級至 Vue 3 并利用其新特性進行優(yōu)化后,性能顯著提升。
優(yōu)化措施:
- 采用 Composition API 重構(gòu)組件,合理拆分與復用邏輯,減少不必要的狀態(tài)更新與渲染。
- 利用
Suspense組件異步加載商品列表與詳情,搭配骨架屏提升用戶體驗。 - 開啟
keep-alive緩存商品分類與篩選組件,避免重復渲染。 - 使用
v-memo指令緩存結(jié)果,減少重新渲染。 - 優(yōu)化事件監(jiān)聽,采用事件委托和節(jié)流函數(shù)控制事件觸發(fā)頻率。
- 使用 Web Worker 將復雜計算(如數(shù)據(jù)排序、過濾)移到后臺線程,減輕主線程負擔。
- 采用路由懶加載、代碼分割、保持組件精簡策略,利用 Vue Router 的懶加載功能將路由組件按需加載,結(jié)合 Webpack 的代碼分割將應(yīng)用拆分為多個代碼塊,避免在單個組件中集成過多功能。
- 對 Vue、Element Plus 等靜態(tài)資源通過 CDN 加載,減少本地打包體積。
- 使用 Nuxt 3 進行 SSR 渲染和靜態(tài)站點生成,提升首屏加載速度并減少服務(wù)器負載。
- 使用 Vue Devtools、Lighthouse 和 Chrome Performance 等工具驗證優(yōu)化效果。
優(yōu)化效果:
- 首屏加載時間縮短近 60%。
- 滾動流暢度提升,轉(zhuǎn)化率增長。
(二)案例二:某資訊類網(wǎng)站的性能優(yōu)化
該資訊類網(wǎng)站內(nèi)容豐富且圖片較多,移動端加載速度慢,用戶流失嚴重。
優(yōu)化措施:
- 采用響應(yīng)式圖片技術(shù),依據(jù)設(shè)備屏幕尺寸及分辨率精準選擇合適圖片尺寸與格式,如移動端選用 WebP 格式縮小圖片體積。
- 對 CSS 進行精簡,移除未用樣式,整理重復樣式,減小 CSS 文件體積。
- 啟用瀏覽器緩存機制,對圖片、CSS、JavaScript 等靜態(tài)資源設(shè)置長期緩存,借助緩存版本控制避免重復下載。
- 采用漸進式加載策略,先加載基礎(chǔ)骨架屏,再逐步加載內(nèi)容。
優(yōu)化效果:
- 移動端平均加載時間從 8 秒降至 3 秒內(nèi)。
- 頁面切換流暢,用戶留存率顯著提高。
二十六、Vue 3 與 Vue 2 的遷移
(一)遷移策略
- 逐步遷移:采用 Vue 3 的兼容模式,逐步將 Vue 2 組件遷移到 Vue 3。
- 代碼重構(gòu):利用 Vue 3 的新特性重構(gòu)代碼,提升性能和可維護性。
(二)遷移工具
- Vue 3 遷移構(gòu)建工具:使用 Vue 提供的遷移構(gòu)建工具,自動檢測和修復 Vue 2 代碼中的不兼容問題。
- Vue 3 遷移指南:參考 Vue 官方提供的遷移指南,了解詳細的遷移步驟和注意事項。
# 安裝 Vue 3 遷移構(gòu)建工具 npm install @vue/vue3-migration-build
二十七、未來趨勢與展望
(一)Vue 3 的持續(xù)發(fā)展
Vue 3 將繼續(xù)發(fā)展,帶來更多新特性和優(yōu)化。
(二)社區(qū)支持與生態(tài)建設(shè)
Vue 社區(qū)將持續(xù)壯大,提供更多優(yōu)質(zhì)的插件和工具。
(三)與新興技術(shù)的結(jié)合
Vue 3 將與 Web Components、WebAssembly 等新興技術(shù)結(jié)合,拓展應(yīng)用場景。
二十八、總結(jié)
Vue 3 提供了多種內(nèi)置優(yōu)化和手動優(yōu)化手段,包括響應(yīng)式系統(tǒng)優(yōu)化、編譯優(yōu)化、虛擬 DOM 優(yōu)化、異步組件加載、代碼分割、組件緩存等。通過合理利用這些策略,可以讓應(yīng)用性能更上一層樓,在大規(guī)模項目中提升用戶體驗和流暢度。希望開發(fā)者通過代碼實踐,深入理解這些特性的應(yīng)用價值,并在項目中靈活運用。
到此這篇關(guān)于Vue3新特性與最佳實踐總結(jié)與開發(fā)技巧的文章就介紹到這了,更多相關(guān)Vue3新特性與最佳實踐內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
Vue 動態(tài)添加表單實現(xiàn)動態(tài)雙向綁定
動態(tài)表單是一個常見的需求,本文詳細介紹了Vue.js中實現(xiàn)動態(tài)表單的創(chuàng)建,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧2024-12-12
從vue基礎(chǔ)開始創(chuàng)建一個簡單的增刪改查的實例代碼(推薦)
這篇文章主要介紹了從vue基礎(chǔ)開始創(chuàng)建一個簡單的增刪改查的實例代碼,需要的朋友參考下2018-02-02
vue動畫—通過鉤子函數(shù)實現(xiàn)半場動畫操作
這篇文章主要介紹了vue動畫—通過鉤子函數(shù)實現(xiàn)半場動畫操作,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2020-08-08

