{"id":33385,"date":"2025-04-27T11:23:12","date_gmt":"2025-04-27T03:23:12","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/33385.html"},"modified":"2025-04-27T11:23:12","modified_gmt":"2025-04-27T03:23:12","slug":"vue3-%e8%87%aa%e5%ae%9a%e4%b9%89%e6%8c%87%e4%bb%a4%e5%ae%8c%e5%85%a8%e6%8c%87%e5%8d%97","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/33385.html","title":{"rendered":"Vue3 \u81ea\u5b9a\u4e49\u6307\u4ee4\u5b8c\u5168\u6307\u5357"},"content":{"rendered":"<h2>Vue3 \u81ea\u5b9a\u4e49\u6307\u4ee4\u5b8c\u5168\u6307\u5357<\/h2>\n<h3>\u76ee\u5f55<\/h3>\n<ul>\n<li>\u57fa\u672c\u6982\u5ff5<\/li>\n<li>\u6307\u4ee4\u6ce8\u518c\u65b9\u5f0f<\/li>\n<li>\u5e38\u7528\u5e94\u7528\u573a\u666f<\/li>\n<li>\u6ce8\u610f\u4e8b\u9879<\/li>\n<\/ul>\n<hr \/>\n<h3>\u57fa\u672c\u6982\u5ff5<\/h3>\n<p>\u5728Vue3\u4e2d&#xff0c;\u81ea\u5b9a\u4e49\u6307\u4ee4\u662f\u7528\u4e8e\u76f4\u63a5\u64cd\u4f5cDOM\u7684\u91cd\u8981\u5de5\u5177\u3002\u76f8\u6bd4Vue2&#xff0c;Vue3\u7684\u6307\u4ee4\u7cfb\u7edf\u8fdb\u884c\u4e86\u4f18\u5316\u548c\u7b80\u5316\u3002<\/p>\n<h4>\u751f\u547d\u5468\u671f\u94a9\u5b50<\/h4>\n<table>\n<tr>\u94a9\u5b50\u540d\u79f0\u5bf9\u5e94Vue2\u540d\u79f0\u89e6\u53d1\u65f6\u673a<\/tr>\n<tbody>\n<tr>\n<td>created<\/td>\n<td>bind<\/td>\n<td>\u5143\u7d20\u5c5e\u6027\u7ed1\u5b9a\u524d<\/td>\n<\/tr>\n<tr>\n<td>beforeMount<\/td>\n<td>inserted<\/td>\n<td>\u5143\u7d20\u63d2\u5165\u7236\u8282\u70b9\u524d<\/td>\n<\/tr>\n<tr>\n<td>mounted<\/td>\n<td>&#8211;<\/td>\n<td>\u5143\u7d20\u63d2\u5165\u7236\u8282\u70b9\u540e<\/td>\n<\/tr>\n<tr>\n<td>beforeUpdate<\/td>\n<td>update<\/td>\n<td>\u7ec4\u4ef6\u66f4\u65b0\u524d<\/td>\n<\/tr>\n<tr>\n<td>updated<\/td>\n<td>componentUpdated<\/td>\n<td>\u7ec4\u4ef6\u53ca\u5b50\u7ec4\u4ef6\u66f4\u65b0\u540e<\/td>\n<\/tr>\n<tr>\n<td>beforeUnmount<\/td>\n<td>unbind<\/td>\n<td>\u5143\u7d20\u5378\u8f7d\u524d<\/td>\n<\/tr>\n<tr>\n<td>unmounted<\/td>\n<td>&#8211;<\/td>\n<td>\u5143\u7d20\u5378\u8f7d\u540e<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h3>\u6307\u4ee4\u6ce8\u518c\u65b9\u5f0f<\/h3>\n<h4>\u5168\u5c40\u6ce8\u518c<\/h4>\n<p><span class=\"token comment\">\/\/ main.js<\/span><br \/>\n<span class=\"token keyword\">const<\/span> app <span class=\"token operator\">&#061;<\/span> <span class=\"token function\">createApp<\/span><span class=\"token punctuation\">(<\/span>App<span class=\"token punctuation\">)<\/span><\/p>\n<p>app<span class=\"token punctuation\">.<\/span><span class=\"token function\">directive<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#039;focus&#039;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token function\">mounted<\/span><span class=\"token punctuation\">(<\/span><span class=\"token parameter\">el<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    el<span class=\"token punctuation\">.<\/span><span class=\"token function\">focus<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<h4>\u5c40\u90e8\u6ce8\u518c<\/h4>\n<p><span class=\"token keyword\">export<\/span> <span class=\"token keyword\">default<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n  directives<span class=\"token operator\">:<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    highlight<span class=\"token operator\">:<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n      <span class=\"token function\">mounted<\/span><span class=\"token punctuation\">(<\/span><span class=\"token parameter\">el<span class=\"token punctuation\">,<\/span> binding<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        el<span class=\"token punctuation\">.<\/span>style<span class=\"token punctuation\">.<\/span>backgroundColor <span class=\"token operator\">&#061;<\/span> binding<span class=\"token punctuation\">.<\/span>value <span class=\"token operator\">||<\/span> <span class=\"token string\">&#039;yellow&#039;<\/span><br \/>\n      <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<hr \/>\n<h3>\u5e38\u7528\u5e94\u7528\u573a\u666f<\/h3>\n<h4>1. \u81ea\u52a8\u805a\u7126<\/h4>\n<p><span class=\"token comment\">\/\/ \u4f7f\u7528<\/span><br \/>\n<span class=\"token operator\">&lt;<\/span>input v<span class=\"token operator\">&#8211;<\/span>focus<span class=\"token operator\">&gt;<\/span><\/p>\n<p><span class=\"token comment\">\/\/ \u5b9e\u73b0<\/span><br \/>\napp<span class=\"token punctuation\">.<\/span><span class=\"token function\">directive<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#039;focus&#039;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token function\">mounted<\/span><span class=\"token punctuation\">(<\/span><span class=\"token parameter\">el<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    el<span class=\"token punctuation\">.<\/span><span class=\"token function\">focus<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<h4>2. \u6743\u9650\u63a7\u5236<\/h4>\n<p><span class=\"token comment\">\/\/ \u4f7f\u7528<\/span><br \/>\n<span class=\"token operator\">&lt;<\/span>button v<span class=\"token operator\">&#8211;<\/span>permission<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;[&#039;admin&#039;]&#034;<\/span><span class=\"token operator\">&gt;<\/span>\u5220\u9664<span class=\"token operator\">&lt;<\/span><span class=\"token operator\">\/<\/span>button<span class=\"token operator\">&gt;<\/span><\/p>\n<p><span class=\"token comment\">\/\/ \u5b9e\u73b0<\/span><br \/>\napp<span class=\"token punctuation\">.<\/span><span class=\"token function\">directive<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#039;permission&#039;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token function\">mounted<\/span><span class=\"token punctuation\">(<\/span><span class=\"token parameter\">el<span class=\"token punctuation\">,<\/span> binding<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">const<\/span> roles <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token string\">&#039;user&#039;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#039;editor&#039;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#039;admin&#039;<\/span><span class=\"token punctuation\">]<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">!<\/span>binding<span class=\"token punctuation\">.<\/span>value<span class=\"token punctuation\">.<\/span><span class=\"token function\">includes<\/span><span class=\"token punctuation\">(<\/span>roles<span class=\"token punctuation\">.<\/span>current<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n      el<span class=\"token punctuation\">.<\/span>parentNode<span class=\"token punctuation\">.<\/span><span class=\"token function\">removeChild<\/span><span class=\"token punctuation\">(<\/span>el<span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<h4>3. \u9632\u6296\u6307\u4ee4<\/h4>\n<p><span class=\"token comment\">\/\/ \u4f7f\u7528<\/span><br \/>\n<span class=\"token operator\">&lt;<\/span>button v<span class=\"token operator\">&#8211;<\/span>debounce<span class=\"token operator\">:<\/span>click<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;submitForm&#034;<\/span><span class=\"token operator\">&gt;<\/span>\u63d0\u4ea4<span class=\"token operator\">&lt;<\/span><span class=\"token operator\">\/<\/span>button<span class=\"token operator\">&gt;<\/span><\/p>\n<p><span class=\"token comment\">\/\/ \u5b9e\u73b0<\/span><br \/>\napp<span class=\"token punctuation\">.<\/span><span class=\"token function\">directive<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#039;debounce&#039;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token function\">mounted<\/span><span class=\"token punctuation\">(<\/span><span class=\"token parameter\">el<span class=\"token punctuation\">,<\/span> binding<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">let<\/span> timer <span class=\"token operator\">&#061;<\/span> <span class=\"token keyword\">null<\/span><br \/>\n    el<span class=\"token punctuation\">.<\/span><span class=\"token function\">addEventListener<\/span><span class=\"token punctuation\">(<\/span>binding<span class=\"token punctuation\">.<\/span>arg<span class=\"token punctuation\">,<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&#061;&gt;<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n      <span class=\"token function\">clearTimeout<\/span><span class=\"token punctuation\">(<\/span>timer<span class=\"token punctuation\">)<\/span><br \/>\n      timer <span class=\"token operator\">&#061;<\/span> <span class=\"token function\">setTimeout<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&#061;&gt;<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        binding<span class=\"token punctuation\">.<\/span><span class=\"token function\">value<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\n      <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">500<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<hr \/>\n<h3>\u8fdb\u9636\u6280\u5de7<\/h3>\n<h4>\u52a8\u6001\u53c2\u6570\u4f20\u9012<\/h4>\n<p><span class=\"token comment\">\/\/ \u4f7f\u7528<\/span><br \/>\n<span class=\"token operator\">&lt;<\/span>div v<span class=\"token operator\">&#8211;<\/span>pin<span class=\"token operator\">:<\/span><span class=\"token punctuation\">[<\/span>direction<span class=\"token punctuation\">]<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;200&#034;<\/span><span class=\"token operator\">&gt;<\/span><span class=\"token operator\">&lt;<\/span><span class=\"token operator\">\/<\/span>div<span class=\"token operator\">&gt;<\/span><\/p>\n<p><span class=\"token comment\">\/\/ \u5b9e\u73b0<\/span><br \/>\napp<span class=\"token punctuation\">.<\/span><span class=\"token function\">directive<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#039;pin&#039;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token function\">mounted<\/span><span class=\"token punctuation\">(<\/span><span class=\"token parameter\">el<span class=\"token punctuation\">,<\/span> binding<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    el<span class=\"token punctuation\">.<\/span>style<span class=\"token punctuation\">.<\/span>position <span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#039;fixed&#039;<\/span><br \/>\n    <span class=\"token keyword\">const<\/span> direction <span class=\"token operator\">&#061;<\/span> binding<span class=\"token punctuation\">.<\/span>arg <span class=\"token operator\">||<\/span> <span class=\"token string\">&#039;top&#039;<\/span><br \/>\n    el<span class=\"token punctuation\">.<\/span>style<span class=\"token punctuation\">[<\/span>direction<span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&#061;<\/span> binding<span class=\"token punctuation\">.<\/span>value <span class=\"token operator\">&#043;<\/span> <span class=\"token string\">&#039;px&#039;<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<h4>Composition API \u7ed3\u5408<\/h4>\n<p><span class=\"token keyword\">import<\/span> <span class=\"token punctuation\">{<\/span> useScroll <span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">from<\/span> <span class=\"token string\">&#039;.\/scrollComposable&#039;<\/span><\/p>\n<p>app<span class=\"token punctuation\">.<\/span><span class=\"token function\">directive<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#039;scroll&#039;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token function\">mounted<\/span><span class=\"token punctuation\">(<\/span><span class=\"token parameter\">el<span class=\"token punctuation\">,<\/span> binding<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">const<\/span> <span class=\"token punctuation\">{<\/span> start<span class=\"token punctuation\">,<\/span> stop <span class=\"token punctuation\">}<\/span> <span class=\"token operator\">&#061;<\/span> <span class=\"token function\">useScroll<\/span><span class=\"token punctuation\">(<\/span>binding<span class=\"token punctuation\">.<\/span>value<span class=\"token punctuation\">)<\/span><br \/>\n    el<span class=\"token punctuation\">.<\/span>_scrollHandler <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">{<\/span> start<span class=\"token punctuation\">,<\/span> stop <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token function\">start<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  <span class=\"token function\">unmounted<\/span><span class=\"token punctuation\">(<\/span><span class=\"token parameter\">el<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    el<span class=\"token punctuation\">.<\/span>_scrollHandler<span class=\"token punctuation\">.<\/span><span class=\"token function\">stop<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<hr \/>\n<h3>\u6ce8\u610f\u4e8b\u9879<\/h3>\n<li>\u907f\u514d\u8fc7\u5ea6\u4f7f\u7528&#xff1a;\u4f18\u5148\u4f7f\u7528\u7ec4\u4ef6\u5316\u65b9\u6848<\/li>\n<li>\u53c2\u6570\u9a8c\u8bc1&#xff1a;\u4f7f\u7528binding.value\u524d\u8fdb\u884c\u7c7b\u578b\u68c0\u67e5<\/li>\n<li>\u6027\u80fd\u4f18\u5316&#xff1a;\u53ca\u65f6\u5728unmounted\u9636\u6bb5\u6e05\u7406\u526f\u4f5c\u7528<\/li>\n<li>\u547d\u540d\u89c4\u8303&#xff1a;\u4f7f\u7528\u5c0f\u5199\u5b57\u6bcd&#043;\u8fde\u5b57\u7b26\u683c\u5f0f&#xff08;\u5982v-custom-directive&#xff09;<\/li>\n<li>\u6d4f\u89c8\u5668\u517c\u5bb9&#xff1a;\u8c28\u614e\u4f7f\u7528\u65b0API&#xff0c;\u5fc5\u8981\u65f6\u6dfb\u52a0polyfill<\/li>\n<hr \/>\n<h3>\u603b\u7ed3<\/h3>\n<table>\n<tr>\u573a\u666f\u63a8\u8350\u6307\u4ee4\u7c7b\u578b\u793a\u4f8b<\/tr>\n<tbody>\n<tr>\n<td>DOM\u64cd\u4f5c<\/td>\n<td>\u81ea\u5b9a\u4e49\u6307\u4ee4<\/td>\n<td>v-tooltip<\/td>\n<\/tr>\n<tr>\n<td>\u5168\u5c40\u529f\u80fd<\/td>\n<td>\u5168\u5c40\u6307\u4ee4<\/td>\n<td>v-permission<\/td>\n<\/tr>\n<tr>\n<td>\u590d\u6742\u4ea4\u4e92<\/td>\n<td>\u7ec4\u5408\u5f0f\u6307\u4ee4<\/td>\n<td>v-draggable<\/td>\n<\/tr>\n<tr>\n<td>\u7b80\u5355\u6837\u5f0f\u4fee\u6539<\/td>\n<td>\u7c7b\u7ed1\u5b9a<\/td>\n<td>:class&#061;\u201c\u2026\u201d<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u901a\u8fc7\u5408\u7406\u4f7f\u7528\u81ea\u5b9a\u4e49\u6307\u4ee4&#xff0c;\u53ef\u4ee5\u4f7f\u4ee3\u7801\u66f4\u7b80\u6d01\u3001\u7ef4\u62a4\u6027\u66f4\u597d&#xff0c;\u4f46\u8981\u6ce8\u610f\u4fdd\u6301\u6307\u4ee4\u7684\u5355\u4e00\u804c\u8d23\u539f\u5219\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb358\u6b21\uff0c\u70b9\u8d5e3\u6b21\uff0c\u6536\u85cf7\u6b21\u3002\u573a\u666f\u63a8\u8350\u6307\u4ee4\u7c7b\u578b\u793a\u4f8bDOM\u64cd\u4f5c\u81ea\u5b9a\u4e49\u6307\u4ee4v-tooltip\u5168\u5c40\u529f\u80fd\u5168\u5c40\u6307\u4ee4\u590d\u6742\u4ea4\u4e92\u7ec4\u5408\u5f0f\u6307\u4ee4\u7b80\u5355\u6837\u5f0f\u4fee\u6539\u7c7b\u7ed1\u5b9a:class=\u201c\u2026\u201d\u901a\u8fc7\u5408\u7406\u4f7f\u7528\u81ea\u5b9a\u4e49\u6307\u4ee4\uff0c\u53ef\u4ee5\u4f7f\u4ee3\u7801\u66f4\u7b80\u6d01\u3001\u7ef4\u62a4\u6027\u66f4\u597d\uff0c\u4f46\u8981\u6ce8\u610f\u4fdd\u6301\u6307\u4ee4\u7684\u5355\u4e00\u804c\u8d23\u539f\u5219\u3002<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[567,187,90,625,87],"topic":[],"class_list":["post-33385","post","type-post","status-publish","format-standard","hentry","category-server","tag-html","tag-javascript","tag-npm","tag-vue-js","tag-87"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Vue3 \u81ea\u5b9a\u4e49\u6307\u4ee4\u5b8c\u5168\u6307\u5357 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/33385.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Vue3 \u81ea\u5b9a\u4e49\u6307\u4ee4\u5b8c\u5168\u6307\u5357 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb358\u6b21\uff0c\u70b9\u8d5e3\u6b21\uff0c\u6536\u85cf7\u6b21\u3002\u573a\u666f\u63a8\u8350\u6307\u4ee4\u7c7b\u578b\u793a\u4f8bDOM\u64cd\u4f5c\u81ea\u5b9a\u4e49\u6307\u4ee4v-tooltip\u5168\u5c40\u529f\u80fd\u5168\u5c40\u6307\u4ee4\u590d\u6742\u4ea4\u4e92\u7ec4\u5408\u5f0f\u6307\u4ee4\u7b80\u5355\u6837\u5f0f\u4fee\u6539\u7c7b\u7ed1\u5b9a:class=\u201c\u2026\u201d\u901a\u8fc7\u5408\u7406\u4f7f\u7528\u81ea\u5b9a\u4e49\u6307\u4ee4\uff0c\u53ef\u4ee5\u4f7f\u4ee3\u7801\u66f4\u7b80\u6d01\u3001\u7ef4\u62a4\u6027\u66f4\u597d\uff0c\u4f46\u8981\u6ce8\u610f\u4fdd\u6301\u6307\u4ee4\u7684\u5355\u4e00\u804c\u8d23\u539f\u5219\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/33385.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-27T03:23:12+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/33385.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/33385.html\",\"name\":\"Vue3 \u81ea\u5b9a\u4e49\u6307\u4ee4\u5b8c\u5168\u6307\u5357 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-27T03:23:12+00:00\",\"dateModified\":\"2025-04-27T03:23:12+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/33385.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/33385.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/33385.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Vue3 \u81ea\u5b9a\u4e49\u6307\u4ee4\u5b8c\u5168\u6307\u5357\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Vue3 \u81ea\u5b9a\u4e49\u6307\u4ee4\u5b8c\u5168\u6307\u5357 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/33385.html","og_locale":"zh_CN","og_type":"article","og_title":"Vue3 \u81ea\u5b9a\u4e49\u6307\u4ee4\u5b8c\u5168\u6307\u5357 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb358\u6b21\uff0c\u70b9\u8d5e3\u6b21\uff0c\u6536\u85cf7\u6b21\u3002\u573a\u666f\u63a8\u8350\u6307\u4ee4\u7c7b\u578b\u793a\u4f8bDOM\u64cd\u4f5c\u81ea\u5b9a\u4e49\u6307\u4ee4v-tooltip\u5168\u5c40\u529f\u80fd\u5168\u5c40\u6307\u4ee4\u590d\u6742\u4ea4\u4e92\u7ec4\u5408\u5f0f\u6307\u4ee4\u7b80\u5355\u6837\u5f0f\u4fee\u6539\u7c7b\u7ed1\u5b9a:class=\u201c\u2026\u201d\u901a\u8fc7\u5408\u7406\u4f7f\u7528\u81ea\u5b9a\u4e49\u6307\u4ee4\uff0c\u53ef\u4ee5\u4f7f\u4ee3\u7801\u66f4\u7b80\u6d01\u3001\u7ef4\u62a4\u6027\u66f4\u597d\uff0c\u4f46\u8981\u6ce8\u610f\u4fdd\u6301\u6307\u4ee4\u7684\u5355\u4e00\u804c\u8d23\u539f\u5219\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/33385.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-27T03:23:12+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/33385.html","url":"https:\/\/www.wsisp.com\/helps\/33385.html","name":"Vue3 \u81ea\u5b9a\u4e49\u6307\u4ee4\u5b8c\u5168\u6307\u5357 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-27T03:23:12+00:00","dateModified":"2025-04-27T03:23:12+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/33385.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/33385.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/33385.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Vue3 \u81ea\u5b9a\u4e49\u6307\u4ee4\u5b8c\u5168\u6307\u5357"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/33385","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=33385"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/33385\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=33385"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=33385"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=33385"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=33385"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}