(window.webpackJsonp=window.webpackJsonp||[]).push([[107],{542:function(s,t,a){"use strict";a.r(t);var e=a(42),n=Object(e.a)({},(function(){var s=this,t=s.$createElement,a=s._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":s.$parent.slotKey}},[a("h1",{attrs:{id:"_5-2-源码运行方式介绍"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-2-源码运行方式介绍"}},[s._v("#")]),s._v(" 5.2 源码运行方式介绍")]),s._v(" "),a("div",{staticClass:"custom-block warning"},[a("p",{staticClass:"custom-block-title"},[s._v("WARNING")]),s._v(" "),a("p",[s._v("如果你是第一次接触Vue.js框架,或者是Node等前端相关的技术,对他并不了解,建议先花2个小时的时间了解一下他们.")]),s._v(" "),a("p",[s._v("作为后端开发工程师来说,并不需要掌握太多,只需要有一个大概即可.")]),s._v(" "),a("p",[s._v("如果你问我和这些前端相关的技术问题,我是不会告诉你的,因为我也是在学习中的状态")])]),s._v(" "),a("p",[s._v("本篇博客主要是讲解"),a("code",[s._v("knife4j-vue")]),s._v("模块的调试开发过程,目前工程结构如下图：")]),s._v(" "),a("p",[a("img",{attrs:{src:"/knife4j/images/knife4j/construct.png",alt:""}})]),s._v(" "),a("p",[s._v("如果你想基于该源码方式进行调试,在下载下来该文件夹后,首先需要更改"),a("code",[s._v("vue.config.js")]),s._v("文件中的的接口代理地址,因为源码中使用的是localhost,为了方便,你可以更改为目前"),a("code",[s._v("knife4j")]),s._v("线上部署的接口进行调试，如下图：")]),s._v(" "),a("p",[a("img",{attrs:{src:"/knife4j/images/knife4j/proxy-url.png",alt:""}})]),s._v(" "),a("p",[s._v("将以上"),a("code",[s._v("target")]),s._v("地址更改为"),a("code",[s._v("http://knife4j.xiaominfo.com/")])]),s._v(" "),a("p",[s._v("接下来,就可以本地运行了,运行步骤：")]),s._v(" "),a("p",[s._v("一、下载依赖文件(该步骤和Java开发者配置好Maven配置后下载jar包的操作类似)")]),s._v(" "),a("blockquote",[a("p",[s._v("运行该步骤的前提是你本机需要安装Node环境,并且配置好Node相关的环境变量")])]),s._v(" "),a("p",[s._v("在该目录下使用命令进行下载安装：")]),s._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[s._v("yarn")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("install")]),s._v("\n")])])]),a("p",[s._v("二、开发模式运行")]),s._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[s._v("yarn")]),s._v(" serve\n")])])]),a("p",[s._v("三、打包")]),s._v(" "),a("p",[s._v("完成对Vue源码的改动后,需要进行编译打包,命令如下：")]),s._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[s._v("yarn")]),s._v(" build\n")])])]),s._v(" "),a("comment-comment")],1)}),[],!1,null,null,null);t.default=n.exports}}]);