我知道这不是新的情况,但我仍然需要添加自定义的CSS样式和JavaScript。我跟踪官方网站的教程,但是什么也没有发生(没有像树一样显示,也没有显示错误,尽管启用了调试树枝)。
我想添加JavaScript和CSS来显示结构树。在global-styling和global-js中,我所需要的全部都是完全定义的,例如,来自Drupal本身的jQuery和Bootstrap。你能发现代码中的错误吗?
treeview:
version: 1.x
css:
theme:
css/treeview.css: {}
js:
js/treeview.js: {}libraries:
- mytheme/global-styling
- mytheme/global-js
- mytheme/treeview{{ attach_library('mytheme/treeview') }} // I attach customed files(css & js) direct into twig-template.html.twigparameters:
http.response.debug_cacheability_headers: true
twig.config:
debug: true我尝试过这个没有Drupal的treeview。它工作得很完美。
发布于 2017-04-07 04:56:01
在全局样式中添加css和js:
global-styling:
version: VERSION
css:
base:
css/treeview.css: {}
js:
js/treeview.js: {}https://drupal.stackexchange.com/questions/233473
复制相似问题