Symfony 引导已正确导入,但样式不起作用
我按照有关如何在symfony上导入引导的说明进行了操作,但它似乎没有导入任何样式 我尝试在不同的块和分区中导入它,但它似乎没有任何作用。 我使用的是网页包encore,每次都能正确编译 我的app.js文件:Symfony 引导已正确导入,但样式不起作用,symfony,bootstrap-4,twig,Symfony,Bootstrap 4,Twig,我按照有关如何在symfony上导入引导的说明进行了操作,但它似乎没有导入任何样式 我尝试在不同的块和分区中导入它,但它似乎没有任何作用。 我使用的是网页包encore,每次都能正确编译 我的app.js文件: // any CSS you require will output into a single css file (app.css in this case) require('../css/app.css'); require('chartist/dist/chartist.css'
// any CSS you require will output into a single css file (app.css in this case)
require('../css/app.css');
require('chartist/dist/chartist.css');
const Chartist = require('chartist');
window.Chartist = Chartist;
// Need jQuery? Install it with "yarn add jquery", then uncomment to require it.
const $ = require('jquery');
window.$ = $;
// this "modifies" the jquery module: adding behavior to it
// the bootstrap module doesn't export/return anything
require('bootstrap');
我的小枝模板(不是基本模板):
{{{encore_entry_link_tags('app')}
{{{encore_entry_script_tags('app')}
{%block head%}
{%endblock%}
{%block body%}
{%endblock%}
只导入图表样式,否则不导入任何样式
bootstrap和ChartList之间是否存在“风格冲突”的可能性?我已将其用于SCS 在我的app.js文件中:
require('../css/app.scss');
const $ = require('jquery');
global.$ = global.jQuery = $;
require('bootstrap');
// optionally customize some Bootstrap variables
$primary: darken(#428bca, 20%);
$dark: lighten(black,10%);
$light: lighten($dark, 65%);
$white: darken(#FFFFFF, 5%);
// the ~ allows you to reference things in node_modules
@import "~bootstrap/scss/bootstrap";
上面最后一行导入引导javascript
然后在我的app.scss文件中:
require('../css/app.scss');
const $ = require('jquery');
global.$ = global.jQuery = $;
require('bootstrap');
// optionally customize some Bootstrap variables
$primary: darken(#428bca, 20%);
$dark: lighten(black,10%);
$light: lighten($dark, 65%);
$white: darken(#FFFFFF, 5%);
// the ~ allows you to reference things in node_modules
@import "~bootstrap/scss/bootstrap";
上面的最后一行是导入引导样式的位置