[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"$f2blc7wtcbbyke":3,"portal-md-d9d84f4dfad104787d6fdb21a07ef049":737},{"code":4,"data":5},2000,{"sectionUuid":6,"section":7,"prev":735,"next":736},"2845b3555cf10d9b04a284f7eb19933c",{"uuid":6,"name":8,"category":9,"menu":10},"Vue3","大前端",[11,65,173,201,260,309,329,353,369,389,501,549,638,666,682,705,713],{"id":12,"isCategory":13,"label":14,"children":15,"access":29},15,true,"Vue3开发教程",[16,20,25,30,34,38,42,45,49,53,57,61],{"id":17,"path":6,"label":18,"access":19},2,"Vue3 简介·概述介绍","free",{"id":21,"path":22,"label":23,"access":24},3,"55876053a5e2daeb8e80175566d1fbd4","Vue3 开发环境安装·快速上手","closed",{"id":26,"path":27,"label":28,"access":29},4,"c2d713d3ed9a73bf61257511196b0c13","Vue3 起步·在HTML中使用Vue3基本步骤","vip",{"id":31,"path":32,"label":33,"access":29},5,"","开发工具nvm的使用",{"id":35,"path":36,"label":37,"access":29},6,"d0b9f2f4ab245f8b029777ce31db0410","介绍并安装vue-cli",{"id":39,"path":40,"label":41,"access":29},7,"b73d33e9ebfad2764df82c6fbff302db","基于vue-cli创建vue项目",{"id":43,"path":22,"label":44,"access":24},8,"Vue3 vue-create",{"id":46,"path":47,"label":48,"access":29},9,"683094a9669a62d1baf568d9780206b3","Vue2和Vue3的不同点和区别总结",{"id":50,"path":51,"label":52,"access":29},10,"253ac94fc1db27b57243644d4d2fb56b","使用npm安装第三方包",{"id":54,"path":55,"label":56,"access":29},11,"54fc1d8cf03c309ef0bc9d4b6cfbaff7","npm相关配置方法",{"id":58,"path":59,"label":60,"access":29},12,"11738c7055542ee5d175ff33d831f5ea","npm命令总结",{"id":62,"path":63,"label":64,"access":29},13,"cd3b4b564bb5803d5ee821828638b5df","package.json文件结构介绍",{"id":66,"isCategory":13,"label":67,"children":68,"access":29},44,"基础",[69,73,77,81,85,89,93,97,101,105,109,113,117,121,125,129,133,137,141,145,149,153,157,161,165,169],{"id":70,"path":71,"label":72,"access":29},17,"e33dba8c879a8ae9de022104fd4e72ce","Vue3 插值表达式·模板语法",{"id":74,"path":75,"label":76,"access":29},18,"ab43d162f2f8401ac010ccf5ec62d8ab","Vue3 定义和渲染数据",{"id":78,"path":79,"label":80,"access":29},19,"13793fc90002f07e0f8212b00bd0e339","Vue3 指令介绍与常用指令的分类",{"id":82,"path":83,"label":84,"access":29},20,"2057f7dc770a7848fcd2b418a3b65324","Vue3 内容渲染指令",{"id":86,"path":87,"label":88,"access":29},21,"fab82c5552b3aff007c4ec50e35546cd","Vue3 条件渲染指令-条件语句",{"id":90,"path":91,"label":92,"access":29},22,"cb1295a1e728a10109d6e087f8938c04","Vue3 列表渲染指令-循环语句v-for",{"id":94,"path":95,"label":96,"access":29},23,"f23df5583edf8a02f2101cc85294a2ab","Vue3 属性绑定指令",{"id":98,"path":99,"label":100,"access":29},24,"eafc78d16ecd3b53e002ad588c468073","Vue3 样式Style绑定",{"id":102,"path":103,"label":104,"access":29},25,"629e0c94142d8b4bad4375f6753c3b06","Vue3 类Class绑定",{"id":106,"path":107,"label":108,"access":29},26,"d045ada0796760234b05e7b92bb0d65c","Vue3 双向绑定指令v-model",{"id":110,"path":111,"label":112,"access":29},27,"5b8326b466b9f9e97c0cccdcaca19e03","Vue3 事件绑定指令v-on",{"id":114,"path":115,"label":116,"access":29},28,"c9204dbe95a101b75364cca56d60ffca","Vue3 事件处理",{"id":118,"path":119,"label":120,"access":29},29,"18108a3189446b2744a4d4487907371a","Vue3 自定义指令",{"id":122,"path":123,"label":124,"access":29},30,"79532d8bb51fb5806f91e3e016a71ae0","Vue3 属性和方法",{"id":126,"path":127,"label":128,"access":29},31,"9950594ef71ffc5efaeda83137c5fb1b","Vue3 计算属性",{"id":130,"path":131,"label":132,"access":29},32,"03813b6e22b02076430805fbc56a65eb","Vue3 监听属性",{"id":134,"path":135,"label":136,"access":29},33,"5e1383a7f67e545a21793acd9ed7a2c4","Vue3 自定义属性",{"id":138,"path":139,"label":140,"access":29},34,"0c4883cf95b9b1f0f558a243a284f378","Vue3 表单",{"id":142,"path":143,"label":144,"access":29},35,"1c014e99717c9a840f0e6a68a9062ee5","Vue3 表单输入绑定（v-model）",{"id":146,"path":147,"label":148,"access":29},36,"624e78f1b46b9b752b792f19ffa5f784","Vue3 组合式API介绍",{"id":150,"path":151,"label":152,"access":29},37,"4efe4b9c78859c8e88a2cea2e669c355","Vue3 组合式API Setup",{"id":154,"path":155,"label":156,"access":29},38,"471c26b5c28e0120843e5792b6015a0a","Vue3 组合式API 生命周期钩子",{"id":158,"path":159,"label":160,"access":29},39,"59389b4d8b149d231979477142ed1ae6","Vue3 组合式API 提供\u002F注入",{"id":162,"path":163,"label":164,"access":29},40,"08cd9a0f316d8482d92b102cd9a2475d","Vue3 组合式API 模板引用",{"id":166,"path":167,"label":168,"access":29},41,"bb4d903713442b0f0cde01cc20cbcd7e","Vue3 响应式基础与生命周期",{"id":170,"path":171,"label":172,"access":29},42,"8d99ae5ad6e8fdbb8f873429828b8c50","Vue3 组件基础之定义与注册",{"id":174,"isCategory":13,"label":175,"children":176,"access":29},53,"Vue3组件基础",[177,181,185,189,193,197],{"id":178,"path":179,"label":180,"access":29},46,"92e646fc69b7faaa2d9569a173a6af83","Vue3 单文件组件（SPA）",{"id":182,"path":183,"label":184,"access":29},47,"286e5a3cf01b43968a0d6c654f2c1c50","Vue3 子组件",{"id":186,"path":187,"label":188,"access":29},48,"8adae22057ac0ef9ec0d6be85d018007","Vue3 应用&组件实例",{"id":190,"path":191,"label":192,"access":29},49,"2039764a3bbef7bbf6942fe339582a34","Vue3 Data Property和方法",{"id":194,"path":195,"label":196,"access":29},50,"551c286e843d3878bda25e9af3759d73","Vue3 创建项目与目录结构",{"id":198,"path":199,"label":200,"access":29},51,"698ee6b9218668b0d05848a056a75413","Vue3 选项Data API",{"id":202,"isCategory":13,"label":203,"children":204,"access":29},70,"Vue3深入组件",[205,208,212,216,220,224,228,232,236,240,244,248,252,256],{"id":206,"path":171,"label":207,"access":29},55,"Vue3 组件注册",{"id":209,"path":210,"label":211,"access":29},56,"0ffdac51bebd7d4f2f3378ac338679a8","Vue3 组件v-model",{"id":213,"path":214,"label":215,"access":29},57,"681c77cab020be424679c6db53b16999","Vue3 组件之间的通信",{"id":217,"path":218,"label":219,"access":29},58,"b7a5cbdbfca6d56b10088caa247ebefe","Vue3 组件Props",{"id":221,"path":222,"label":223,"access":29},59,"4077ca6ca20d443111439c92545e45e6","Vue3 非Prop的Attribute",{"id":225,"path":226,"label":227,"access":29},60,"b9153d002d418fb6ef17e223873e2b84","Vue3 组件通信$emit自定义事件",{"id":229,"path":230,"label":231,"access":29},61,"dcc1510e2006f1aa685a9efdd1babffa","Vue3 插槽（slots）",{"id":233,"path":234,"label":235,"access":29},62,"6fd8ad5654201434b5d816452d30ab71","Vue3 具名插槽和作用域插槽",{"id":237,"path":238,"label":239,"access":29},63,"b847cb38b1ddf752654cd319b736c623","Vue3 提供（依赖）\u002F注入",{"id":241,"path":242,"label":243,"access":29},64,"f29b798947e485e1e39810fdab788c19","Vue3 动态组件&异步组件",{"id":245,"path":246,"label":247,"access":29},65,"9e0b7f756dfc5a8efbe4ec9100a707b8","Vue3 动态组件与插槽",{"id":249,"path":250,"label":251,"access":29},66,"11b1a6ffdbdb6bb08e53af9cd3d8a8e1","Vue3 模板引用",{"id":253,"path":254,"label":255,"access":29},67,"c273e360aabd7c3e7d8b860901581d80","Vue3 处理边界情况",{"id":257,"path":258,"label":259,"access":29},68,"43a9266b01a83fa42b83191632513c96","Vue3 透传Attributes",{"id":261,"isCategory":13,"label":262,"children":263,"access":29},84,"内置组件-可复用逻辑&组合",[264,268,272,276,280],{"id":265,"path":266,"label":267,"access":29},72,"b4baf160c03d435cb3a9d6f08f1db73a","Vue3 混入",{"id":269,"path":270,"label":271,"access":29},73,"aa8b24a69b6fa801fa4083f3b3b306d0","Vue3 组合式函数",{"id":273,"path":274,"label":275,"access":29},74,"0e948e33ad7773e2356fb55259c45b3a","Vue3 渲染函数",{"id":277,"path":278,"label":279,"access":29},75,"70737a26da6802ddc1164b4039dd379a","Vue3 插件",{"id":281,"path":282,"label":283,"children":284,"access":29},76,"36922145dfa9d6dae38d0feb9c96d38e","Vue3 内置组件",[285,289,293,297,301,305],{"id":286,"path":287,"label":288,"access":29},77,"73d7bd6416c4d4b44626f8586733eaa8","Vue3 Teleport",{"id":290,"path":291,"label":292,"access":29},78,"89e1756649da2af34a47b423dc784376","Vue3 内置组件KeepAlive",{"id":294,"path":295,"label":296,"access":29},79,"6c9f21df72761b4060007d2ec183b78b","Vue3 内置组件TransitionGroup",{"id":298,"path":299,"label":300,"access":29},80,"56d2688935954c9817e500fa50053c74","Vue3 内置组件Suspense",{"id":302,"path":303,"label":304,"access":29},81,"21d13ee10daac6fb38e2948e270d8f27","Vue3 内置组件Teleport",{"id":306,"path":307,"label":308,"access":29},82,"6f9527cae23bbf998ffe97d56d1d592c","Vue3 内置组件Transition",{"id":310,"isCategory":13,"label":311,"children":312,"access":29},91,"Vue3过渡&动画",[313,317,321,325],{"id":314,"path":315,"label":316,"access":29},86,"8665985a788ed4d149c0698289995829","Vue3 过渡&动画概述",{"id":318,"path":319,"label":320,"access":29},87,"7f058f3264c39000575317d80d9e4ce6","Vue3 进入过渡&离开过渡",{"id":322,"path":323,"label":324,"access":29},88,"6abc2f6f03d00811e99729541209ee55","Vue3 列表过渡",{"id":326,"path":327,"label":328,"access":29},89,"acb6e9adffe113dba7b0be47156bc5ac","Vue3 状态过渡",{"id":330,"isCategory":13,"label":331,"children":332,"access":29},99,"路由",[333,337,341,345,349],{"id":334,"path":335,"label":336,"access":29},93,"dfee08fd1f8b000c1d66b3051e928a6a","Vue3 路由介绍与安装配置使用",{"id":338,"path":339,"label":340,"access":29},94,"afddb9b6152f1355f354bdbe28b8c733","Vue3 路由匹配语法：路由和查询参数",{"id":342,"path":343,"label":344,"access":29},95,"f3ab43cc3c1ae26248e1b9833f9a4a73","Vue3 嵌套路由和编程式导航",{"id":346,"path":347,"label":348,"access":29},96,"7a894b514ebf3a5beabf49f5b1f6d07e","Vue3 命名路由、命名视图、重定向和别名使用介绍",{"id":350,"path":351,"label":352,"access":29},97,"1c315d779f93fa39d951ca0b7d4be21b","Vue3 路由使用技巧：路由组件传参、不同的历史纪录模式、导航守卫和路由懒加载",{"id":354,"isCategory":13,"label":355,"children":356,"access":29},105,"状态管理",[357,361,365],{"id":358,"path":359,"label":360,"access":29},101,"a7454eebf54815aba881fff4c757fb7a","Vue3 状态管理介绍和使用技巧",{"id":362,"path":363,"label":364,"access":29},102,"22ad5ade27a954fc22c9c498bb44d74c","Vue3 状态管理Vuex",{"id":366,"path":367,"label":368,"access":24},103,"d9cb0ca4b48f286e8e793d9458e53692","Vue3 状态管理Pinia",{"id":370,"isCategory":13,"label":371,"children":372,"access":29},112,"Vue3工具链",[373,377,381,385],{"id":374,"path":375,"label":376,"access":29},107,"3961e2f1ecd79f468e97c6b9a5473fee","Vue3 工具链",{"id":378,"path":379,"label":380,"access":29},108,"5aaf29607497b474c8cdda370daa144c","Vue3 测试",{"id":382,"path":383,"label":384,"access":29},109,"437bf780b59277acf33e0aa98ca76c04","Vue3 打包发布与部署",{"id":386,"path":387,"label":388,"access":29},110,"b233a2952ae86ae2c7aa43e4f4fd0ad0","Vue3 Mobile",{"id":390,"isCategory":13,"label":391,"children":392,"access":29},142,"Vue3进阶",[393,397,401,405,409,413,417,421,425,429,433,437,441,445,449,453,457,461,465,469,473,477,481,485,489,493,497],{"id":394,"path":395,"label":396,"access":29},114,"72a248c49c50a7f27a75b93b938c0cdd","Vue3 v-for中的Ref数组",{"id":398,"path":399,"label":400,"access":29},115,"01e755de47b8f4666b8b276a7513f8f4","Vue3 异步组件",{"id":402,"path":403,"label":404,"access":29},116,"79a088b347298b9950c96ee667f5fde1","Vue3 attribute强制行为",{"id":406,"path":407,"label":408,"access":29},117,"9ff9bb88164cd03e673a07f580829b92","Vue3 自定义元素交互",{"id":410,"path":411,"label":412,"access":29},118,"e07b156a697755ca0283b5615dd0cae8","Vue3 Data选项",{"id":414,"path":415,"label":416,"access":29},119,"7a953be963122bd27eb1a71d4f5801a2","Vue3 事件API",{"id":418,"path":419,"label":420,"access":29},120,"d34bc6f76a88f3a4ddeb64ace861f995","Vue3 过滤器",{"id":422,"path":423,"label":424,"access":29},121,"5b113a325306cc5285fb1aae900cb69b","Vue3 片段",{"id":426,"path":427,"label":428,"access":29},122,"d5805cb3782b99efabd9f70a54221947","Vue3 函数式组件",{"id":430,"path":431,"label":432,"access":29},123,"a60d54dbd5486c010314b6bc0a57aa3a","Vue3 全局API",{"id":434,"path":435,"label":436,"access":29},124,"e7b9ae93ed9b8e1a24c2987afbcf73d0","Vue3 全局API Treeshaking",{"id":438,"path":439,"label":440,"access":29},125,"66dce32028848afd5b724e1d0836153d","Vue3 内联模板 Attribute",{"id":442,"path":443,"label":444,"access":29},126,"169b28e61f1521c97fac56ae0cb80062","Vue3 key attribute",{"id":446,"path":447,"label":448,"access":29},127,"48952bcd55a0db98d662537f7c51d978","Vue3 按键修饰符",{"id":450,"path":451,"label":452,"access":29},128,"8b8027888d0ac1e864050bef1f1ac489","Vue3 在prop的默认函数中访问this",{"id":454,"path":455,"label":456,"access":29},129,"b797b8ac68b9c8b78aa5484ff70c140f","Vue3 Slot统一",{"id":458,"path":459,"label":460,"access":29},130,"0bb35dd127235b476fb8b70a962ea6f2","Vue3 过渡的class名更改",{"id":462,"path":463,"label":464,"access":29},131,"e7d43a40e244638da3b48ab91b365ebf","Vue3 v-model",{"id":466,"path":467,"label":468,"access":29},132,"abc72875e1b1ac0ac419dd5c22b91296","Vue3 v-if与v-for的优先级对比",{"id":470,"path":471,"label":472,"access":29},133,"b06ab69a69b38afdef4963605570f00c","Vue3 v-bind合并行为",{"id":474,"path":475,"label":476,"access":29},134,"2d4c1e9a58f05805c019f4af91735ca9","使用 Vue 的多种方式",{"id":478,"path":479,"label":480,"access":29},135,"eb5791bd62c6e986c276ca986d2e090a","组合式 API 常见问答",{"id":482,"path":483,"label":484,"access":29},136,"ab1a984d7de394cbee4cd307b6de306d","Vue3 深入响应式系统",{"id":486,"path":487,"label":488,"access":29},137,"bcabb3b2494bd3588a68398f65241e87","Vue 与 Web Components",{"id":490,"path":491,"label":492,"access":29},138,"9155839ffdf9feb84a0eb14de4bc1d31","Vue3 动画技巧",{"id":494,"path":495,"label":496,"access":29},139,"d5c57ca7bc2a53f9ceb5023b4bd90e10","Vue3 渲染函数API",{"id":498,"path":499,"label":500,"access":29},140,"4d52306aee155843f2c1d745fb839eb6","Vue3 渲染函数和JSX",{"id":502,"isCategory":13,"label":503,"children":504,"access":29},156,"Vue3 API参考",[505,509,513,517,521,525,529,533,537,541,545],{"id":506,"path":507,"label":508,"access":29},144,"9afeaaaa57b894b88a1ac0a9b0969e2c","Vue3 应用配置API",{"id":510,"path":511,"label":512,"access":29},145,"a7a94cb9a6f08511157144f1ea9c539e","Vue3 应用API",{"id":514,"path":515,"label":516,"access":29},146,"54fc7bc8848a6b6845c8085c0891eaf2","Vue3 选项-DOM",{"id":518,"path":519,"label":520,"access":29},147,"97ed53ca289983b1bfd7c7381068b197","Vue3 选项-生命周期钩子",{"id":522,"path":523,"label":524,"access":29},148,"a0391ca0870736684b39d61a4cb82bf3","Vue3 选项\u002F资源",{"id":526,"path":527,"label":528,"access":29},149,"c2fcc664277717f4a38e15f0c850ccf1","Vue3 选项-组合",{"id":530,"path":531,"label":532,"access":29},150,"e4589098226bfbbb5c1000477b333071","Vue3 选项-杂项",{"id":534,"path":535,"label":536,"access":29},151,"fa01bf2865c4d9e36a6aeaf238a6d5dc","Vue3 实例property",{"id":538,"path":539,"label":540,"access":29},152,"a8ae4f82960d6d6072214abcab9604e5","Vue3 实例方法",{"id":542,"path":543,"label":544,"access":29},153,"fda8b7f06dfeb7b36b2d320cc2a9e44b","Vue3 指令",{"id":546,"path":547,"label":548,"access":29},154,"987458cd4f549df2fe8d40a48bb95983","Vue3 特殊指令",{"id":550,"isCategory":13,"label":551,"children":552,"access":29},180,"Vue3高阶",[553,557,561,565,569,573,577,581,585],{"id":554,"path":555,"label":556,"access":29},158,"3b3e4ab90d2da9596baa80082efab868","Vue3 响应性-基础",{"id":558,"path":559,"label":560,"access":29},159,"7a8682f964fca11fe22053b6f13b4094","Vue3 响应性基础 API",{"id":562,"path":563,"label":564,"access":29},160,"0638057a2ec4ac65b684f925c6111d78","Vue3 响应性API Refs",{"id":566,"path":567,"label":568,"access":29},161,"2cc2a40d05c0006ad08904e3ca2c517d","Vue3 响应性API Computed与watch",{"id":570,"path":571,"label":572,"access":29},162,"694c4ce56e3c0373ffbcbcccd09ce992","Vue3 响应性-深入响应性原理",{"id":574,"path":575,"label":576,"access":29},163,"6d9e9524d2667dddba59b77dcb1a6191","Vue3 响应性-计算和侦听",{"id":578,"path":579,"label":580,"access":29},164,"e259a4e425cccd7c3cd97b8ebdeffb16","Vue3 渲染机制",{"id":582,"path":583,"label":584,"access":29},165,"c071bdd6d90c7b5a113c39f1bc5897a6","Vue3 渲染机制和优化",{"id":586,"path":587,"label":588,"children":589,"access":29},166,"724580f34475b9c89c4ed9fa34ce5578","Vue3 HTTP请求Axios介绍与环境准备",[590,594,598,602,606,610,614,618,622,626,630,634],{"id":591,"path":592,"label":593,"access":29},167,"b70f20ae0796a3da9b1fac6437c09561","Axios API基础用法",{"id":595,"path":596,"label":597,"access":29},168,"4172c6a5d6deaca456d26ef5b75d0d08","Axios 请求配置",{"id":599,"path":600,"label":601,"access":29},169,"d5c091ad6642c38418da33831562199f","Axios 请求和响应处理以及响应结构",{"id":603,"path":604,"label":605,"access":29},170,"77ad9391308dc606f4f2c69aa7cc205c","Axios 配置默认值",{"id":607,"path":608,"label":609,"access":29},171,"48d0c21ffd4456d9a9f22ac6317d4720","Axios 全局配置和拦截器",{"id":611,"path":612,"label":613,"access":29},172,"9a890e723982ab21bfa0363a4179925a","Axios 错误处理",{"id":615,"path":616,"label":617,"access":29},173,"2022cb83668410ac85dcf5435b4b15e2","Axios 取消请求",{"id":619,"path":620,"label":621,"access":29},174,"34c170677473063b4d6b6a1b2ca252f2","Axios 使用 application\u002Fx-www-form-urlencoded 格式",{"id":623,"path":624,"label":625,"access":29},175,"ec94c0d3bbe910269bce18b2ef3fae14","Axios 并发请求",{"id":627,"path":628,"label":629,"access":29},176,"4cd29b6c2d31b9b9ca95f4a33915153a","Axios 上传与下载文件",{"id":631,"path":632,"label":633,"access":29},177,"2bf05998d811448d7a840bf3a203f54f","Axios 测试与调试",{"id":635,"path":636,"label":637,"access":29},178,"b4d93ecbcf3671954fb3310324329a68","使用Axios响应数据的转换",{"id":639,"isCategory":13,"label":640,"children":641,"access":29},189,"最佳实践",[642,646,650,654,658,662],{"id":643,"path":644,"label":645,"access":29},182,"d775d9462488d0f8b8b118a7d4fe1d8a","Vue3 服务端渲染（SSR）",{"id":647,"path":648,"label":649,"access":29},183,"c7e479468c43e0173df2e4a32933cbab","Vue3 生产部署",{"id":651,"path":652,"label":653,"access":29},184,"8619f00295f6f722454873a8f069350d","Vue3 性能优化",{"id":655,"path":656,"label":657,"access":29},185,"a075b1e61a6b43428bf66e23af488f39","Vue3 无障碍访问",{"id":659,"path":660,"label":661,"access":29},186,"6ad19d0b7fe1e2540fe61f1cea86184c","Vue3 安全",{"id":663,"path":664,"label":665,"access":29},187,"cdba5367c6d602727b810082a1eece93","Vue3 风格指南",{"id":667,"isCategory":13,"label":668,"children":669,"access":29},195,"TypeScript",[670,674,678],{"id":671,"path":672,"label":673,"access":29},191,"7d829ac6a27b91db169428038c718807","Vue3 TypeScript支持",{"id":675,"path":676,"label":677,"access":29},192,"0c0e0b643e5a7a0b4245aa7373223fbc","TS 与组合式 API",{"id":679,"path":680,"label":681,"access":29},193,"6a8041805a09dac337a4910b8f5a5cd7","TS 与选项式 API",{"id":683,"isCategory":13,"label":684,"children":685,"access":29},203,"应用案例",[686,690,694,698,702],{"id":687,"path":688,"label":689,"access":19},197,"d9d84f4dfad104787d6fdb21a07ef049","Vue3 整合第三方库\u002F插件\u002F框架\u002F组件使用方法",{"id":691,"path":692,"label":693,"access":19},198,"d98eadbdf291d5e1884633b215c382e8","Vue3 第三方库\u002F插件\u002F框架\u002F组件清单",{"id":695,"path":696,"label":697,"access":29},199,"9174b7a9e62b45edbc2b42819f35d30b","Vue3 实现点击按钮重新加载组件",{"id":699,"path":700,"label":701,"access":29},200,"5840914c440f6d280aa3a1d6deadeed6","Vue3 点击按钮将condition复制到剪切板中",{"id":703,"path":32,"label":704,"access":29},201,"Vue3 ElementPlus实现计算器工具",{"id":706,"isCategory":13,"label":707,"children":708,"access":29},207,"错误解决方案记录",[709],{"id":710,"path":711,"label":712,"access":24},205,"a3e94e111386d63da321c2f79f3f348e","基础级错误解决方法",{"id":714,"label":715,"children":716,"access":29},215,"扩展阅读",[717,720,723,726,729,732],{"id":718,"path":32,"label":719,"access":29},209,"前端面试题",{"id":721,"path":32,"label":722,"access":29},210,"常用插件推荐",{"id":724,"path":32,"label":725,"access":29},211,"社区资源与学习资料",{"id":727,"path":32,"label":728,"access":29},212,"毕业设计(毕设)",{"id":730,"path":32,"label":731,"access":29},213,"学习路线图",{"id":733,"path":32,"label":734,"access":29},214,"招聘岗位",{"path":680,"label":681,"access":29},{"path":692,"label":693,"access":19},{"code":4,"msg":738,"data":739},"success",{"last_modify_datetime":740,"sys_article_tags":741,"custom_article_tags":742,"special_column":743,"title":746,"id":32,"markdown":747,"number_of_visits":745,"next_page_url":692,"next_page_title":748,"last_page_url":680,"last_page_title":749,"category_path":750},"2026-07-26 23:39:09",[],[],{"name":744,"article_nums":745,"subscribe_nums":745},"公众号：CTO Plus",0,"Vue 第三方库的使用方法","开发技巧\n\nVue.js 作为一款渐进式 JavaScript 框架，其生态系统包含了众多优秀的第三方库。这些库能够帮助开发者快速实现特定功能，提高开发效率。本文将详细介绍如何在 Vue 项目中使用第三方库，包括选择、安装、配置和实际应用的全过程。\n\n## 第三方库的选择\n\n在选择第三方库时，需要考虑以下几个因素：\n\n- **维护状态**：查看库的最近更新时间和 issue 解决情况\n- **文档质量**：完善的文档能降低学习成本\n- **社区支持**：活跃的社区能提供更好的技术支持\n- **兼容性**：确保库与当前 Vue 版本兼容\n- **性能影响**：评估库对项目性能的影响\n\n## 安装第三方库\n\n### 使用 npm 或 yarn 安装\n\n大多数 Vue 第三方库可以通过 npm 或 yarn 进行安装：\n\n```bash\n# 使用 npm\nnpm install library-name\n\n# 使用 yarn\nyarn add library-name\n```\n\n### 通过 CDN 引入\n\n对于一些轻量级库，也可以直接通过 CDN 引入：\n\n```html\n\u003Cscript src=\"https:\u002F\u002Fcdn.example.com\u002Flibrary.js\">\u003C\u002Fscript>\n```\n\n## 配置和使用第三方库\n\n### 全局引入和配置\n\n许多 Vue 插件需要全局引入并进行配置：\n\n```javascript\n\u002F\u002F main.js\nimport Vue from 'vue'\nimport Library from 'library-name'\nimport 'library-name\u002Fdist\u002Flibrary.css'\n\nVue.use(Library, {\n  \u002F\u002F 可选的配置选项\n  option1: value1,\n  option2: value2\n})\n```\n\n### 局部引入和使用\n\n对于某些组件级别的库，可以在单个组件中引入：\n\n```javascript\n\u002F\u002F Component.vue\nimport { LibraryComponent } from 'library-name'\n\nexport default {\n  components: {\n    LibraryComponent\n  }\n}\n```\n\n## 常用 Vue 第三方库示例\n\n### 状态管理：Vuex\n\nVuex 是 Vue 官方推荐的状态管理库。\n\n#### 安装\n\n```bash\nnpm install vuex\n```\n\n#### 配置和使用\n\n```javascript\n\u002F\u002F store\u002Findex.js\nimport Vue from 'vue'\nimport Vuex from 'vuex'\n\nVue.use(Vuex)\n\nexport default new Vuex.Store({\n  state: {\n    count: 0\n  },\n  mutations: {\n    increment(state) {\n      state.count++\n    }\n  },\n  actions: {\n    incrementAsync({ commit }) {\n      setTimeout(() => {\n        commit('increment')\n      }, 1000)\n    }\n  },\n  getters: {\n    doubleCount: state => state.count * 2\n  }\n})\n```\n\n```javascript\n\u002F\u002F main.js\nimport Vue from 'vue'\nimport store from '.\u002Fstore'\n\nnew Vue({\n  store,\n  render: h => h(App)\n}).$mount('#app')\n```\n\n```vue\n\u003C!-- Component.vue -->\n\u003Ctemplate>\n  \u003Cdiv>\n    \u003Cp>{{ count }}\u003C\u002Fp>\n    \u003Cp>{{ doubleCount }}\u003C\u002Fp>\n    \u003Cbutton @click=\"increment\">增加\u003C\u002Fbutton>\n    \u003Cbutton @click=\"incrementAsync\">异步增加\u003C\u002Fbutton>\n  \u003C\u002Fdiv>\n\u003C\u002Ftemplate>\n\n\u003Cscript>\nimport { mapState, mapGetters, mapActions } from 'vuex'\n\nexport default {\n  computed: {\n    ...mapState(['count']),\n    ...mapGetters(['doubleCount'])\n  },\n  methods: {\n    ...mapActions(['incrementAsync']),\n    increment() {\n      this.$store.commit('increment')\n    }\n  }\n}\n\u003C\u002Fscript>\n```\n\n### UI 组件库：Element UI\n\nElement UI 是一套为开发者、设计师和产品经理准备的桌面端组件库。\n\n#### 安装\n\n```bash\nnpm install element-ui\n```\n\n#### 完整引入\n\n```javascript\n\u002F\u002F main.js\nimport Vue from 'vue'\nimport ElementUI from 'element-ui'\nimport 'element-ui\u002Flib\u002Ftheme-chalk\u002Findex.css'\n\nVue.use(ElementUI)\n```\n\n#### 按需引入\n\n```bash\nnpm install babel-plugin-component -D\n```\n\n```javascript\n\u002F\u002F babel.config.js\nmodule.exports = {\n  plugins: [\n    [\n      'component',\n      {\n        libraryName: 'element-ui',\n        styleLibraryName: 'theme-chalk'\n      }\n    ]\n  ]\n}\n```\n\n```javascript\n\u002F\u002F main.js\nimport Vue from 'vue'\nimport { Button, Select } from 'element-ui'\n\nVue.component(Button.name, Button)\nVue.component(Select.name, Select)\n```\n\n#### 使用示例\n\n```vue\n\u003Ctemplate>\n  \u003Cel-container>\n    \u003Cel-header>头部\u003C\u002Fel-header>\n    \u003Cel-main>\n      \u003Cel-button type=\"primary\" @click=\"handleClick\">主要按钮\u003C\u002Fel-button>\n      \u003Cel-select v-model=\"value\" placeholder=\"请选择\">\n        \u003Cel-option\n          v-for=\"item in options\"\n          :key=\"item.value\"\n          :label=\"item.label\"\n          :value=\"item.value\">\n        \u003C\u002Fel-option>\n      \u003C\u002Fel-select>\n    \u003C\u002Fel-main>\n  \u003C\u002Fel-container>\n\u003C\u002Ftemplate>\n\n\u003Cscript>\nexport default {\n  data() {\n    return {\n      value: '',\n      options: [\n        { value: 'option1', label: '选项1' },\n        { value: 'option2', label: '选项2' }\n      ]\n    }\n  },\n  methods: {\n    handleClick() {\n      this.$message('按钮被点击了')\n    }\n  }\n}\n\u003C\u002Fscript>\n```\n\n### 路由管理：Vue Router\n\nVue Router 是 Vue.js 官方的路由管理器。\n\n#### 安装\n\n```bash\nnpm install vue-router\n```\n\n#### 配置和使用\n\n```javascript\n\u002F\u002F router\u002Findex.js\nimport Vue from 'vue'\nimport Router from 'vue-router'\nimport Home from '..\u002Fviews\u002FHome.vue'\nimport About from '..\u002Fviews\u002FAbout.vue'\n\nVue.use(Router)\n\nexport default new Router({\n  mode: 'history',\n  routes: [\n    {\n      path: '\u002F',\n      name: 'home',\n      component: Home\n    },\n    {\n      path: '\u002Fabout',\n      name: 'about',\n      component: About\n    }\n  ]\n})\n```\n\n```javascript\n\u002F\u002F main.js\nimport Vue from 'vue'\nimport router from '.\u002Frouter'\n\nnew Vue({\n  router,\n  render: h => h(App)\n}).$mount('#app')\n```\n\n```vue\n\u003C!-- App.vue -->\n\u003Ctemplate>\n  \u003Cdiv id=\"app\">\n    \u003Cnav>\n      \u003Crouter-link to=\"\u002F\">首页\u003C\u002Frouter-link>\n      \u003Crouter-link to=\"\u002Fabout\">关于\u003C\u002Frouter-link>\n    \u003C\u002Fnav>\n    \u003Crouter-view\u002F>\n  \u003C\u002Fdiv>\n\u003C\u002Ftemplate>\n```\n\n### HTTP 客户端：Axios\n\nAxios 是一个基于 promise 的 HTTP 库。\n\n#### 安装\n\n```bash\nnpm install axios\n```\n\n#### 基本使用\n\n```javascript\n\u002F\u002F src\u002Fservices\u002Fapi.js\nimport axios from 'axios'\n\n\u002F\u002F 创建实例\nconst api = axios.create({\n  baseURL: 'https:\u002F\u002Fapi.example.com',\n  timeout: 10000\n})\n\n\u002F\u002F 请求拦截器\napi.interceptors.request.use(\n  config => {\n    \u002F\u002F 在发送请求之前做些什么\n    const token = localStorage.getItem('token')\n    if (token) {\n      config.headers.Authorization = `Bearer ${token}`\n    }\n    return config\n  },\n  error => {\n    \u002F\u002F 对请求错误做些什么\n    return Promise.reject(error)\n  }\n)\n\n\u002F\u002F 响应拦截器\napi.interceptors.response.use(\n  response => {\n    \u002F\u002F 对响应数据做点什么\n    return response.data\n  },\n  error => {\n    \u002F\u002F 对响应错误做点什么\n    return Promise.reject(error)\n  }\n)\n\nexport default api\n```\n\n```vue\n\u003C!-- UserComponent.vue -->\n\u003Ctemplate>\n  \u003Cdiv>\n    \u003Cbutton @click=\"getUsers\">获取用户列表\u003C\u002Fbutton>\n    \u003Cul>\n      \u003Cli v-for=\"user in users\" :key=\"user.id\">{{ user.name }}\u003C\u002Fli>\n    \u003C\u002Ful>\n  \u003C\u002Fdiv>\n\u003C\u002Ftemplate>\n\n\u003Cscript>\nimport api from '..\u002Fservices\u002Fapi'\n\nexport default {\n  data() {\n    return {\n      users: []\n    }\n  },\n  methods: {\n    async getUsers() {\n      try {\n        this.users = await api.get('\u002Fusers')\n      } catch (error) {\n        console.error('获取用户列表失败:', error)\n      }\n    }\n  }\n}\n\u003C\u002Fscript>\n```\n\n### 国际化：Vue I18n\n\nVue I18n 是 Vue.js 的国际化插件。\n\n#### 安装\n\n```bash\nnpm install vue-i18n\n```\n\n#### 配置和使用\n\n```javascript\n\u002F\u002F src\u002Fi18n.js\nimport Vue from 'vue'\nimport VueI18n from 'vue-i18n'\n\nVue.use(VueI18n)\n\nconst messages = {\n  en: {\n    message: {\n      hello: 'Hello world',\n      welcome: 'Welcome to our app'\n    }\n  },\n  zh: {\n    message: {\n      hello: '你好世界',\n      welcome: '欢迎使用我们的应用'\n    }\n  }\n}\n\nconst i18n = new VueI18n({\n  locale: 'zh', \u002F\u002F 设置默认语言\n  fallbackLocale: 'en', \u002F\u002F 设置回退语言\n  messages\n})\n\nexport default i18n\n```\n\n```javascript\n\u002F\u002F main.js\nimport Vue from 'vue'\nimport i18n from '.\u002Fi18n'\n\nnew Vue({\n  i18n,\n  render: h => h(App)\n}).$mount('#app')\n```\n\n```vue\n\u003C!-- LocalizedComponent.vue -->\n\u003Ctemplate>\n  \u003Cdiv>\n    \u003Cp>{{ $t('message.hello') }}\u003C\u002Fp>\n    \u003Cp>{{ $t('message.welcome') }}\u003C\u002Fp>\n    \n    \u003Cbutton @click=\"changeLanguage('en')\">English\u003C\u002Fbutton>\n    \u003Cbutton @click=\"changeLanguage('zh')\">中文\u003C\u002Fbutton>\n  \u003C\u002Fdiv>\n\u003C\u002Ftemplate>\n\n\u003Cscript>\nexport default {\n  methods: {\n    changeLanguage(lang) {\n      this.$i18n.locale = lang\n    }\n  }\n}\n\u003C\u002Fscript>\n```\n\n## 自定义第三方库的封装\n\n为了更好地组织和复用代码，可以封装自定义的库：\n\n```javascript\n\u002F\u002F src\u002Flibs\u002FcustomLibrary.js\nexport const utilityFunction1 = () => {\n  \u002F\u002F 工具函数1\n}\n\nexport const utilityFunction2 = () => {\n  \u002F\u002F 工具函数2\n}\n\nexport default {\n  install(Vue, options = {}) {\n    \u002F\u002F 添加全局方法或属性\n    Vue.prototype.$customMethod = () => {\n      \u002F\u002F 自定义全局方法\n    }\n\n    \u002F\u002F 添加全局资源\n    Vue.directive('custom-directive', {\n      bind(el, binding, vnode, oldVnode) {\n        \u002F\u002F 指令逻辑\n      }\n    })\n\n    \u002F\u002F 注入组件选项\n    Vue.mixin({\n      created() {\n        \u002F\u002F 混入逻辑\n      }\n    })\n\n    \u002F\u002F 添加实例方法\n    Vue.prototype.$customProperty = '自定义属性'\n  }\n}\n```\n\n```javascript\n\u002F\u002F main.js\nimport Vue from 'vue'\nimport CustomLibrary from '.\u002Flibs\u002FcustomLibrary'\n\nVue.use(CustomLibrary, {\n  \u002F\u002F 配置选项\n})\n```\n\n## 最佳实践和注意事项\n\n### 性能优化\n\n1. **按需引入**：只引入需要的组件和功能\n2. **懒加载**：对大型库使用懒加载\n3. **Tree Shaking**：利用现代打包工具的 tree shaking 功能\n\n### 错误处理\n\n```javascript\n\u002F\u002F 统一的错误处理机制\nVue.config.errorHandler = (err, vm, info) => {\n  console.error(`Error: ${err.toString()}\\nInfo: ${info}`)\n  \u002F\u002F 可以在这里添加错误上报逻辑\n}\n```\n\n### 版本管理\n\n保持第三方库版本的稳定性，定期更新并测试兼容性：\n\n```json\n{\n  \"dependencies\": {\n    \"vue\": \"^2.6.0\",\n    \"vuex\": \"^3.0.0\",\n    \"vue-router\": \"^3.0.0\"\n  }\n}\n```\n\n## 调试和问题解决\n\n### 常见问题\n\n1. **版本冲突**：使用 `npm ls` 检查依赖关系\n2. **配置错误**：仔细阅读文档中的配置选项\n3. **兼容性问题**：检查库与 Vue 版本的兼容性\n\n### 调试技巧\n\n```javascript\n\u002F\u002F 在组件中检查库是否正确注入\nmounted() {\n  console.log(this.$library) \u002F\u002F 检查库实例\n  console.log(Vue.prototype) \u002F\u002F 检查全局注入的方法\n}\n```\n\n## 结语\n\nVue 第三方库的使用是 Vue 开发中的重要组成部分。通过合理选择、正确配置和优化使用第三方库，可以显著提高开发效率和项目质量。掌握这些技能，将有助于构建更加健壮和可维护的 Vue 应用程序。","UI组件","Vue3 TypeScript与选项式API深度解析","\u002Fvue"]