在我陈述我的问题之前,我做了以下事情:
我已经按照Getting started中的所有内容进行了操作,并在我的laravel项目中安装了框架。我也回答了here的答案并对stackoverflow进行了快速搜索,但无法找到解决方案。
现在的问题是我不能在我的页面中包含semantic.min.css和semantic.min.js,因为它找不到。我需要有人帮助我在5.6 laravel项目中使用语义ui的正确指令。
这是我的HTML代码到目前为止:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Gym Management</title>
<link rel="stylesheet" type="text/css" href="{{ asset("semantic/dist/semantic.min.css") }}">
<link rel="stylesheet" href="../css/style.css">
<script src="https://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script>
<script src="{{ asset("semantic/dist/semantic.min.js") }}"></script>
</head>
<body>
<div class="ui container">
HELLO
</div>
webpack.mix.js
let mix = require('laravel-mix');
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
| file for the application as well as bundling up all the JS files.
|
*/
mix.js('resources/assets/js/app.js', 'public/js')
.sass('resources/assets/sass/app.scss', 'public/css')
.copy('node_modules/semantic-ui-css/semantic.min.css','public/css/semantic.min.css')
.copy('node_modules/semantic-ui-css/semantic.min.js','public/js/semantic.min.js');
大多数情况下,由于路径错误,我收到此错误。仔细检查你的路径两次。具有js和css文件的“semantic”文件夹必须位于公用文件夹中。