小编Leo*_*nho的帖子

使用 symfony 4 提供静态文件夹

我想复制 Vue.js 生成的 dist 文件夹并在 symfony 路由上提供它,我尝试过:

路线.yaml

vue:
  path: /{path}
  controller: App\Controller\ApiController::vue
  methods: [GET]
  requirements:
    path: .*
Run Code Online (Sandbox Code Playgroud)

ApiController.php

public function vue()
{
    $vuepath = __DIR__.'/../../public/dist/index.html';
    return new Response(file_get_contents($vuepath));
}
Run Code Online (Sandbox Code Playgroud)

它启动时index.html不会加载 javascript 文件。我该如何送达我的申请?

static symfony serve

7
推荐指数
1
解决办法
1683
查看次数

单击div下面的元素?

我可以给出一个例子:

.nightly{
  z-index: 9000; 
  position: fixed; 
  height: 100%; 
  width: 100%; 
  background-color: rgba(0,0,0,0.5);
}
Run Code Online (Sandbox Code Playgroud)
<div class="nightly">
</div>

<div class="body">
  <button>Test</button>
  <a href="#">Test 1</a>
</div>
Run Code Online (Sandbox Code Playgroud)

想知道div.nightly点击的"透明" 怎么样,或者可以点击下面的按钮,链接等?

javascript jquery html5 css3

0
推荐指数
1
解决办法
79
查看次数

标签 统计

css3 ×1

html5 ×1

javascript ×1

jquery ×1

serve ×1

static ×1

symfony ×1