我正在检查我的刀片模板中的路由,li使用以下代码将活动类添加到菜单中的特定类:
<ul>
<li class="{{ Request::is('*/sobre') || Request::is('*') ? "active" : "" }}">
<a href="{{ Route::getCurrentRoute()->parameters()['domain'] . "/sobre" }}">Sobre o salão</a>
</li>
<li class="{{ Request::is('*/servicos') ? "active" : "" }}">
<a href="{{ Route::getCurrentRoute()->parameters()['domain'] . "/servicos" }}">Serviços</a>
</li>
<li class="{{ Request::is('*/avaliacoes') ? "active" : "" }}">
<a href="{{ Route::getCurrentRoute()->parameters()['domain'] . "/avaliacoes" }}">Avaliações</a>
</li>
<li class="{{ Request::is('*/galeria') ? "active" : "" }}">
<a href="{{ Route::getCurrentRoute()->parameters()['domain'] . "/galeria" }}">Fotos</a>
</li>
</ul>
Run Code Online (Sandbox Code Playgroud)
这些是路线:
Route::group(['prefix' => '{domain}', 'middleware'=>'salao'], function () {
Route::get('/', 'Frontend\FrontendSalaoController@sobre');
Route::get('sobre', …Run Code Online (Sandbox Code Playgroud) 在我的应用程序内部,存在一个名为的路由组admin,该组内的任何路由都会调用两个资源:public/css/admin.css并且public/js/admin.js,但是任何未经身份验证的用户都可以访问这些文件.如何在Auth Middleware中包含这些文件?
我的管理路线:
Route::group(['prefix' => 'admin', 'middleware' => ['auth']], function () {
Route::get('/', 'Admin\IndexController@index')->name('panel');
Route::group(['prefix' => 'users'], function() {});
Route::group(['prefix' => 'settings'], function() {});
Route::fallback('Admin\ExceptionController@exception');
});
Run Code Online (Sandbox Code Playgroud)
我的资源链接:
http://localhost:3000/css/admin.css
http://localhost:3000/js/admin.js
Run Code Online (Sandbox Code Playgroud)
我的资源链接应该是:
http://localhost:3000/admin/css/admin.css
http://localhost:3000/admin/js/admin.js
Run Code Online (Sandbox Code Playgroud)
如果我只需要创建一个文件夹admin里面public的文件夹我刚刚得到一个403错误...
我能做些什么呢?
我正在尝试在Vue条件内使用window对象:
<li v-if="window.SpeechRecognition || window.webkitSpeechRecognition">
<a href="#">Voice</a>
</li>
Run Code Online (Sandbox Code Playgroud)
但我收到以下错误:
[Vue warn]: Property or method "window" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property.
Run Code Online (Sandbox Code Playgroud)
如何解决此错误,并且仅在用户的浏览器支持这些功能时才显示HTML元素SpeechRecognition?
如何使用Webpack编译Simditor?
我正在尝试使用 Laravel Mix 编译 Simditor,但出现以下错误:
Uncaught TypeError: Simditor.connect is not a function
Run Code Online (Sandbox Code Playgroud)
这是我的js文件:
window.$ = window.jQuery = require('jquery');
import 'simple-module';
import 'simditor';
$(document).ready(function () {
$('.input.text-editor').each(function () {
var editor = new Simditor({
textarea: $(this).find('textarea')
});
});
});
Run Code Online (Sandbox Code Playgroud)
知道为什么我会收到此错误吗?
编辑器网站:simditor.tower.im
我和我的同事正在网络共享的 PhpStorm 中进行同一个项目,碰巧我们正在编辑同一个 Javascript 文件,但是当我更改文件时,他的计算机上的更新文件有延迟,并且是相同的与我一起。有没有办法让 PhpStorm 在检测到更改时更新文件?没有这个延迟?
我正在创建一个高级管理面板,我正在玩编辑项目的一部分,我喜欢它,当我点击编辑一个项目,他将填充其父项的整个空间,但我不知道如何使元素回来到动画的原始位置,任何想法如何做到这一点?到目前为止我试过这个:
这是一支钢笔:http://codepen.io/anon/pen/WvGONp
HTML
<div id="container">
<div class="single-item">
<div class="title">home</div>
<a class="edit" href="#"></a>
</div>
<div class="single-item">
<div class="title">Gallery</div>
<a class="edit" href="#"></a>
</div>
<div class="single-item">
<div class="title">Contact</div>
<a class="edit" href="#"></a>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
SCSS
* {
margin: 0;
padding: 0;
border: 0;
box-sizing: border-box;
}
html, body, #container {
height: 100%;
min-height: 100%;
}
#container{
& > .single-item{
position: relative;
background-color: #d9d9d9;
border-radius: 2px;
margin-bottom: 15px;
padding: 15px;
z-index: 1;
& > .edit{
display: block;
position: absolute;
background-color: #000;
top: …Run Code Online (Sandbox Code Playgroud) 我正在使用vue.js和moment.js创建一个计时器,我只用了几分钟和几秒钟,我的代码应该可以工作,但是我没有得到想要的结果:
var app = new Vue({
el: '#app',
data: {
date: moment(60 * 10 * 1000)
},
computed: {
time: function(){
return this.date.format('mm:ss');
}
},
mounted: function(){
var aa = this.date;
setInterval(function(){
aa.subtract(1, 'seconds');
}, 1000);
}
});Run Code Online (Sandbox Code Playgroud)
<script src="https://momentjs.com/downloads/moment.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.min.js"></script>
<div id="app">{{ time }}</div>Run Code Online (Sandbox Code Playgroud)
我正在将 html 中的播放器转换为 Vue 组件。
组件的一半已创建,仅缺少时间控制滑块。
这是 html 播放器代码(Vue 组件中已经实现了具有多个选项卡的行):
var audioPlayer = document.querySelector('.green-audio-player');
var playPause = audioPlayer.querySelector('#playPause');
var playpauseBtn = audioPlayer.querySelector('.play-pause-btn');
var loading = audioPlayer.querySelector('.loading');
var progress = audioPlayer.querySelector('.progress');
var sliders = audioPlayer.querySelectorAll('.slider');
var player = audioPlayer.querySelector('audio');
var currentTime = audioPlayer.querySelector('.current-time');
var totalTime = audioPlayer.querySelector('.total-time');
var speaker = audioPlayer.querySelector('#speaker');
var draggableClasses = ['pin'];
var currentlyDragged = null;
window.addEventListener('mousedown', function(event) {
if(!isDraggable(event.target)) return false;
currentlyDragged = event.target;
let handleMethod = currentlyDragged.dataset.method;
this.addEventListener('mousemove', window[handleMethod], false);
window.addEventListener('mouseup', () => {
currentlyDragged = …Run Code Online (Sandbox Code Playgroud)我不是Eloquent大师,我做了很多研究,无法重现我的预期。
我有以下型号:
<?php
use Illuminate\Database\Eloquent\Model;
class Invoice extends Model
{
protected $fillable = [
'uuid',
'number_id'
];
protected $dates = [
'started_at',
'ended_at'
];
public $timestamps = false;
public function contacts()
{
return $this->hasMany(Contact::class);
}
}
Run Code Online (Sandbox Code Playgroud)
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Contact extends Model
{
protected $fillable = [
'incoming_messages',
'outgoing_messages',
'outgoing_template_messages',
];
public $timestamps = false;
public function invoice()
{
return $this->belongsTo(Invoice::class);
}
}
Run Code Online (Sandbox Code Playgroud)
当我搜索特定的时Invoice::class:
$invoice = Invoice::number($number)
->latest('started_at')
->with(['contacts'])
->firstOrFail();
Run Code Online (Sandbox Code Playgroud)
我需要它以这种方式返回:
{
"id": …Run Code Online (Sandbox Code Playgroud) 我正在用Vue构建的应用程序中创建一个组件。此组件是倒计时,范围从X分钟到00:00。
我知道可以进行动画处理svg以获得期望的结果,但是我没有必要的知识。我从未使用过任何svg图书馆。
我需要在进度组件中创建以下动画:
动画需要根据天气顺畅地遵循路径。路径节点应根据时间插入/更新。
这是我的实际倒数组件:
var app = new Vue({
el: '#app',
data: {
date: moment(2 * 60 * 1000)
},
computed: {
time: function(){
return this.date.format('mm:ss');
}
},
mounted: function(){
var timer = setInterval(() => {
this.date = moment(this.date.subtract(1, 'seconds'));
if(this.date.diff(moment(0)) === 0){
clearInterval(timer);
alert('Done!');
}
}, 1000);
}
});Run Code Online (Sandbox Code Playgroud)
<script src="https://momentjs.com/downloads/moment.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.min.js"></script>
<div id="app">{{ time }}</div>Run Code Online (Sandbox Code Playgroud)
这是进度圈的svg:
<svg x="0px" y="0px" viewBox="0 0 90 90">
<style type="text/css">
.st0{fill:#FFFFFF;}
.st1{fill:none;stroke:#B5B5B5;stroke-miterlimit:10;}
.st2{fill:none;stroke:#408EFF;stroke-linecap:round;stroke-miterlimit:10;} …Run Code Online (Sandbox Code Playgroud)