问题标签 [webpack-handlebars-loader]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
html - Handlebars 将“@partial-block”内容移动到页面末尾
我正在使用带有 webpack 和 handlebars-loader 的车把(用于 webpack 的车把模板加载器。)来实现多页 Web 应用程序。以下是我的视图文件夹(.hbs 文件)的结构
- 意见
成分
- 侧边栏.hbs
布局
- 默认.hbs
- 产品.hbs
索引.hbs
product-1.hbs
product-2.hbs
...
我的问题是我在车把中看到“部分挡块”的奇怪行为。我有两个布局来包装每个页面的主要内容。但我的布局没有在右行加载“部分块”。无论我在布局中使用部分块的何处,把手都会在该位置关闭正文和 html 标记,并在 html 关闭标记之后呈现部分块内容。
下面是我在 body 中加载部分块的示例默认布局:
我使用默认布局的 index.hbs 文件
并渲染 html 文件
就像我说的,主标签在关闭 html 标签之后出现,这不是预期的行为。