Skip to content

Custom helpers compiled incorrectly #3

@luran813

Description

@luran813

1.template-helpers.js


Template7.registerHelper('steps', function(step1, step2) {
  var str = 
    '<div class="steps">'+
      '<div class="step1">' + step1 + '</div>' +
      '<div class="step2">' + step2 + '</div>' +
    '</div>';
  return str;
});
module.exports = ['steps'];
  1. .f7.html content is:
    {{steps 'step1' 'step2'}}

  2. webpack.config.dev.js

        test: /\.f7.html$/,
        use: [
          'babel-loader',
          {
            loader: 'framework7-component-loader',
            options: {
              helpersPath: './src/js/template-helpers.js',
              partialsPath: './src/template/',
              partialsExt: '.f7p.html'
            }
          }
        ],
      },
  1. Compile error :
ERROR in ./src/../aa.f7.html                                                                            
Module build failed (from ./node_modules/framework7-component-loader/lib/index.js):                                     
Error: Template7: Missing helper: "steps"                                                                               
    at Template7Class.compile (D:\luran\projects\xinge-pk-copy\bmanagersys\node_modules\template7\dist\template7.js:590:17)                                                                                                                     
    at Function.compile (D:\luran\projects\xinge-pk-copy\bmanagersys\node_modules\template7\dist\template7.js:655:21)   
    at Object.loader (D:\luran\projects\xinge-pk-copy\bmanagersys\node_modules\framework7-component-loader\lib\index.js:161:43)                                                                                                                 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions