当前位置: 首页 > 后端技术 > PHP

vuethink安装部署

时间:2023-03-30 04:36:37 PHP

下载安装下载vuethink,gitclonehttps://github.com/honraytech/VueThink.git,下载后可以看到VueThink目录下有frontEnd和php,frontEnd是vue搭建的前端模块-cli脚手架,php包含thinkphp5框架本地域名DocumentRoot"E:\wamp\www\VueThink"ServerNamevt.com后端配置新建一个数据库,将php下的install.sql导入到新建的数据库中,然后配置config/database.php下的php;配置完成后,打开浏览器访问http://vt.com/php/,如果看到'vuethinkinterface'字样,说明成功.baseURL='http://vt.com/php/index.php'window.HOST='http://vt.com/php/index.php'配置完成后,在前端npmrundev运行开发版(localhost:8080或vt.com:8080),npmrunbuildpackagerelease版本,将build生成的dist下的static目录和index.html复制到VueThink目录下,在浏览器中输入vt.com访问其他问题eslint错误你可能会遇到eslint的疯狂错误,打开frontEnd/build/webpack.base.conf.js,注释掉eslint配置eslint:{//configFile:'./.eslintrc.json'},module:{preLoaders:[//{//test:/\.js$/,//exclude:/node_modules/,//loader:'eslint'//},//{//test:/\.vue$/,//exclude:/node_modules/,//loader:'eslint'//}],构建打包后刷新notfound问题。这是vue-router的history模式的问题。在VueThink下创建一个.htaccess文件,保存如下配置./index.html[L]如果不是Apache,请查看详细文档,或者直接把路由模式改回默认的hash模式(如果不注意路由的话)constrouter=newVueRouter({mode:'hash',base:__dirname,routes})finalstructureVueThinkphp//tp5frontEnd//开发版,脚手架static//打包静态资源index.html//打包入口file.htaccess//配置文件