Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vue.js/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Laravel 让Inerty.js和Xampp协同工作_Laravel_Vue.js_Xampp_Inertiajs - Fatal编程技术网

Laravel 让Inerty.js和Xampp协同工作

Laravel 让Inerty.js和Xampp协同工作,laravel,vue.js,xampp,inertiajs,Laravel,Vue.js,Xampp,Inertiajs,我试着用Laravel、Vue和Inertia建立一个项目。我正在使用xampp在Windows上开发 我已经用以下配置了C:/xampp/apache/conf/extra/httpd-vhosts.conf: <VirtualHost inertia-example.test:80> DocumentRoot "c:/xampp/htdocs/inertia-example/public" <Directory "c:/xampp/htdocs/inertia-e

我试着用Laravel、Vue和Inertia建立一个项目。我正在使用xampp在Windows上开发

我已经用以下配置了C:/xampp/apache/conf/extra/httpd-vhosts.conf:

<VirtualHost inertia-example.test:80>
  DocumentRoot "c:/xampp/htdocs/inertia-example/public" 
  <Directory "c:/xampp/htdocs/inertia-example/public">
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
  </Directory>
</VirtualHost>

DocumentRoot“c:/xampp/htdocs/industry-example/public”
选项索引跟随符号链接
允许超越所有
要求所有授权
我还向C:/Windows/System32/drivers/etc/hosts添加了一个条目

当我转到inertia-example.test时,我看到的是一个h1标记,带有文本“Welcome to Laravel!”,这肯定不是Welcome.vue中的内容

有人有什么想法吗

这里有一个github的链接(),如果有帮助的话

app.blade.php是:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <link href="{{ mix('/css/app.css') }}" rel="stylesheet">
    <script src="{{ mix('/js/app.js') }}" defer></script>
</head>
<body>

@inertia

</body>
</html>

@惯性
路由文件,特别是web.php,是:

<?php

use Inertia\Inertia;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    // return view('welcome');
    return Inertia::render('Welcome');
});

所以,由于我还没有深入到我想做的事情中,我决定停止,卸载XAMPP,安装Laragon,然后从那里开始。我只是按照文件做的,现在一切似乎都在运转。我的直觉告诉我XAMPP不起作用,它与必须手动配置httpd-vhosts.conf和etc/hosts文件有关。

因此,由于我还不太了解我要做的事情,我决定停止,卸载XAMPP,安装Laragon,然后从那里开始。我只是按照文件做的,现在一切似乎都在运转。我的直觉告诉我XAMPP不起作用,它与必须手动配置httpd-vhosts.conf和etc/hosts文件有关。

您配置了路由吗?您是否已按照回购协议中的说明,用
@industry
更新了您的
app.blade.php
?对这两个问题都是。您是否可以显示您的
路线/web.php
app.blade.php
?我已根据要求更新了问题。谢谢。您是否也安装了惯性传感器?如果是,您是否也可以在问题中添加
Welcome.vue
?您是否配置了路线?您是否已按照回购协议中的说明,用
@industry
更新了您的
app.blade.php
?对这两个问题都是。您是否可以显示您的
路线/web.php
app.blade.php
?我已根据要求更新了问题。谢谢。您是否也安装了惯性传感器?如果是,您是否也可以在问题中添加
Welcome.vue
<template>
    <div>
        This is the Welcome page!
    </div>
</template>