{"id":541,"date":"2019-08-12T23:30:50","date_gmt":"2019-08-12T15:30:50","guid":{"rendered":"http:\/\/www.shineskr.com\/?p=541"},"modified":"2019-12-29T19:57:38","modified_gmt":"2019-12-29T11:57:38","slug":"vueelementui%e9%a1%b9%e7%9b%ae%e6%89%93%e5%8c%85%e5%90%8e%e6%a0%b7%e5%bc%8f%e5%8f%98%e5%8c%96%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"https:\/\/www.shineskr.com\/541.html","title":{"rendered":"vue+elementui\u9879\u76ee\u6253\u5305\u540e\u6837\u5f0f\u53d8\u5316\u95ee\u9898"},"content":{"rendered":"<!--wp-compress-html--><!--wp-compress-html no compression--><p>\u521a\u89e3\u51b3\u4e86Vue\u8bbe\u7f6e\u8def\u7531\u4e3aHistory\u6a21\u5f0f\uff0c\u6253\u5305\u540e\u8bbf\u95ee404\u95ee\u9898\u6216index.html\u7a7a\u767d\u95ee\u9898\uff0c\u6253\u5f00\u9879\u76ee\u9875\u9762\u53c8\u53d1\u73b0\u4e86\u6837\u5f0f\u51fa\u4e86\u95ee\u9898\uff0c\u6837\u5f0f\u4e0e\u5f00\u53d1\u7248\u672c\u6709\u4e9b\u4e0d\u540c\uff0c\u6709\u4e9b\u6837\u5f0f\u6ca1\u6709\u751f\u6548\u3002\u901a\u8fc7\u7f51\u4e0a\u67e5\u8d44\u6599\u627e\u5230\u4e86\u95ee\u9898\u6240\u5728\u4ee5\u53ca\u89e3\u51b3\u529e\u6cd5\uff1a<br \/>\n<span style=\"background-color: #e8baba;\"><span style=\"color: #d45d57; background-color: #f5e4e4;\">main.js\u4e2d\u7684\u5f15\u5165\u987a\u5e8f\u51b3\u5b9a\u4e86\u6253\u5305\u540ecss\u7684\u987a\u5e8f<\/span><span style=\"background-color: #ffffff;\">\uff0c\u7ec4\u4ef6\u5185\u7684\u6837\u5f0f\u6ca1\u6709\u751f\u6548\u53ef\u80fd\u662f\u88ab\u7b2c\u4e09\u65b9\u7ec4\u4ef6\u6837\u5f0f\u8986\u76d6\u4e86\uff0c\u6240\u4ee5<span style=\"color: #d45d57; background-color: #f5e4e4;\">\u628a\u7b2c\u4e09\u65b9\u7ec4\u4ef6\u653e\u5728\u524d\u9762\u5f15\u5165\uff0crouter\u548capp\u653e\u5728\u540e\u9762\u5f15\u5165<\/span>\uff0c\u5c31\u53ef\u4ee5\u5b9e\u73b0\u7ec4\u4ef6\u6837\u5f0f\u5728\u7b2c\u4e09\u65b9\u6837\u5f0f\u4e4b\u540e\u6e32\u67d3\u3002\u4ee3\u7801\u5982\u4e0b\uff1a<\/span><\/span><\/p>\n<pre style=\"margin:15px 0;font:100 12px\/18px monaco, andale mono, courier new;padding:10px 12px;border:#ccc 1px solid;border-left-width:4px;background-color:#fefefe;box-shadow:0 0 4px #eee;word-break:break-all;word-wrap:break-word;color:#444\"><span style=\"color:#a50\">\/\/ The Vue build version to load with the `import` command<\/span>\n<span style=\"color:#a50\">\/\/ (runtime-only or standalone) has been set in webpack.base.conf with an alias.<\/span>\n<span style=\"color:#000\">import<\/span> <span style=\"color:#000\">Vue<\/span> <span style=\"color:#000\">from<\/span> <span style=\"color:#a11\">'<a href=\"https:\/\/www.shineskr.com\/tag\/vue\" class=\"tag-tooltip\" data-toggle=\"tooltip\" title=\"\u67e5\u770b\u66f4\u591a\u5173\u4e8e vue \u7684\u6587\u7ae0\" target=\"_blank\">vue<\/a>'<\/span>\n<span style=\"color:#a50\">\/\/ \u5148\u5f15\u5165\u7b2c\u4e09\u65b9\u7ec4\u4ef6<\/span>\n<span style=\"color:#000\">import<\/span> <span style=\"color:#000\">VueCookie<\/span> <span style=\"color:#000\">from<\/span> <span style=\"color:#a11\">'<a href=\"https:\/\/www.shineskr.com\/tag\/vue\" class=\"tag-tooltip\" data-toggle=\"tooltip\" title=\"\u67e5\u770b\u66f4\u591a\u5173\u4e8e vue \u7684\u6587\u7ae0\" target=\"_blank\">vue<\/a>-cookie'<\/span>\n<span style=\"color:#000\">import<\/span> <span style=\"color:#000\">ajax<\/span> <span style=\"color:#000\">from<\/span> <span style=\"color:#a11\">'@\/utils\/ajax'<\/span>\n<span style=\"color:#000\">import<\/span> <span style=\"color:#000\">global<\/span> <span style=\"color:#000\">from<\/span> <span style=\"color:#a11\">'@\/utils\/global'<\/span>\n<span style=\"color:#000\">import<\/span> <span style=\"color:#a11\">'font-awesome\/css\/font-awesome.css'<\/span>\n<span style=\"color:#000\">import<\/span> <span style=\"color:#000\">ueditor<\/span> <span style=\"color:#000\">from<\/span> <span style=\"color:#a11\">'@\/components\/ueditor'<\/span>\n<span style=\"color:#000\">import<\/span> <span style=\"color:#000\">cloneDeep<\/span> <span style=\"color:#000\">from<\/span> <span style=\"color:#a11\">'lodash\/cloneDeep'<\/span>\n<span style=\"color:#000\">import<\/span> <span style=\"color:#000\">ElementUI<\/span> <span style=\"color:#000\">from<\/span> <span style=\"color:#a11\">'<a href=\"https:\/\/www.shineskr.com\/tag\/element-ui\" class=\"tag-tooltip\" data-toggle=\"tooltip\" title=\"\u67e5\u770b\u66f4\u591a\u5173\u4e8e element-ui \u7684\u6587\u7ae0\" target=\"_blank\">element-ui<\/a>'<\/span>\n<span style=\"color:#000\">import<\/span> <span style=\"color:#a11\">'<a href=\"https:\/\/www.shineskr.com\/tag\/element-ui\" class=\"tag-tooltip\" data-toggle=\"tooltip\" title=\"\u67e5\u770b\u66f4\u591a\u5173\u4e8e element-ui \u7684\u6587\u7ae0\" target=\"_blank\">element-ui<\/a>\/lib\/theme-chalk\/index.css'<\/span>\n<span style=\"color:#a50\">\/\/ \u540e\u5f15\u5165router<\/span>\n<span style=\"color:#000\">import<\/span> <span style=\"color:#000\">router<\/span> <span style=\"color:#000\">from<\/span> <span style=\"color:#a11\">'.\/router'<\/span>\n<span style=\"color:#000\">import<\/span> <span style=\"color:#000\">store<\/span> <span style=\"color:#000\">from<\/span> <span style=\"color:#a11\">'@\/store'<\/span>\n<span style=\"color:#000\">import<\/span> <span style=\"color:#000\">App<\/span> <span style=\"color:#000\">from<\/span> <span style=\"color:#a11\">'.\/App'<\/span>\n\n<span style=\"color:#000\">Vue<\/span>.<span style=\"color:#000\">config<\/span>.<span style=\"color:#000\">productionTip<\/span> = <span style=\"color:#219\">false<\/span>\n\n<span style=\"color:#000\">Vue<\/span>.<span style=\"color:#000\">use<\/span>(<span style=\"color:#000\">ElementUI<\/span>)\n<span style=\"color:#000\">Vue<\/span>.<span style=\"color:#000\">use<\/span>(<span style=\"color:#000\">VueCookie<\/span>)\n<span style=\"color:#000\">Vue<\/span>.<span style=\"color:#000\">use<\/span>(<span style=\"color:#000\">ueditor<\/span>)\n\n<span style=\"color:#000\">Vue<\/span>.<span style=\"color:#000\">component<\/span>(<span style=\"color:#a11\">'ueditor'<\/span>, <span style=\"color:#000\">ueditor<\/span>)\n\n<span style=\"color:#000\">Vue<\/span>.<span style=\"color:#000\">prototype<\/span>.<span style=\"color:#000\">$http<\/span> = <span style=\"color:#000\">ajax<\/span>\n<span style=\"color:#000\">Vue<\/span>.<span style=\"color:#000\">prototype<\/span>.<span style=\"color:#000\">$global<\/span> = <span style=\"color:#000\">global<\/span>\n<span style=\"color:#000\">require<\/span>(<span style=\"color:#a11\">'@\/mock'<\/span>)\n\n<span style=\"color:#a50\">\/\/ \u4fdd\u5b58\u6574\u7ad9<a href=\"https:\/\/www.shineskr.com\/tag\/vue\" class=\"tag-tooltip\" data-toggle=\"tooltip\" title=\"\u67e5\u770b\u66f4\u591a\u5173\u4e8e vue \u7684\u6587\u7ae0\" target=\"_blank\">vue<\/a>x\u672c\u5730\u50a8\u5b58\u521d\u59cb\u72b6\u6001<\/span>\n<span style=\"color:#000\">window<\/span>.<span style=\"color:#000\">SITE_CONFIG<\/span>[<span style=\"color:#a11\">'storeState'<\/span>] = <span style=\"color:#000\">cloneDeep<\/span>(<span style=\"color:#000\">store<\/span>.<span style=\"color:#000\">state<\/span>)\n\n<span style=\"color:#a50\">\/* eslint-disable no-new *\/<\/span>\n<span style=\"color:#708\">new<\/span> <span style=\"color:#000\">Vue<\/span>({\n  <span style=\"color:#000\">el<\/span>: <span style=\"color:#a11\">'#app'<\/span>,\n  <span style=\"color:#000\">router<\/span>,\n  <span style=\"color:#000\">store<\/span>,\n  <span style=\"color:#000\">components<\/span>: { <span style=\"color:#000\">App<\/span> },\n  <span style=\"color:#000\">template<\/span>: <span style=\"color:#a11\">'&lt;App\/&gt;'<\/span>\n})\n<\/pre>\n<p>\u8fd9\u6837\u4fee\u6539\u4e4b\u540e\u6837\u5f0f\u95ee\u9898\u5c31\u89e3\u51b3\u4e86\uff0c\u6253\u5305\u540e\u7684\u7248\u672c\u4e0e\u5f00\u53d1\u7248\u672c\u663e\u793a\u4e00\u6837\u3002<\/p>\n<!--wp-compress-html no compression--><!--wp-compress-html-->","protected":false},"excerpt":{"rendered":"\u521a\u89e3\u51b3\u4e86Vue\u8bbe\u7f6e\u8def\u7531\u4e3aHistory\u6a21\u5f0f\uff0c\u6253\u5305\u540e\u8bbf\u95ee404\u95ee\u9898\u6216index.html\u7a7a\u767d\u95ee\u9898\uff0c\u6253\u5f00\u9879\u76ee\u9875\u9762\u53c8\u53d1\u73b0\u4e86\u6837\u5f0f\u51fa\u4e86\u95ee\u9898\uff0c\u6837\u5f0f\u4e0e\u5f00\u53d1\u7248\u672c\u6709\u4e9b\u4e0d\u540c\uff0c\u6709\u4e9b\u6837\u5f0f\u6ca1\u6709\u751f\u6548\u3002\u901a\u8fc7\u7f51\u4e0a\u67e5\u8d44\u6599\u627e\u5230\u4e86\u95ee\u9898\u6240\u5728 \u00b7\u00b7\u00b7","protected":false},"author":1,"featured_media":640,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[52,3],"tags":[57,53,58],"table_tags":[],"_links":{"self":[{"href":"https:\/\/www.shineskr.com\/api\/wp\/v2\/posts\/541"}],"collection":[{"href":"https:\/\/www.shineskr.com\/api\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shineskr.com\/api\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shineskr.com\/api\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shineskr.com\/api\/wp\/v2\/comments?post=541"}],"version-history":[{"count":12,"href":"https:\/\/www.shineskr.com\/api\/wp\/v2\/posts\/541\/revisions"}],"predecessor-version":[{"id":641,"href":"https:\/\/www.shineskr.com\/api\/wp\/v2\/posts\/541\/revisions\/641"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.shineskr.com\/api\/wp\/v2\/media\/640"}],"wp:attachment":[{"href":"https:\/\/www.shineskr.com\/api\/wp\/v2\/media?parent=541"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shineskr.com\/api\/wp\/v2\/categories?post=541"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shineskr.com\/api\/wp\/v2\/tags?post=541"},{"taxonomy":"table_tags","embeddable":true,"href":"https:\/\/www.shineskr.com\/api\/wp\/v2\/table_tags?post=541"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}