Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom helpers compiled incorrectly #3

Open
luran813 opened this issue Sep 4, 2019 · 4 comments
Open

Custom helpers compiled incorrectly #3

luran813 opened this issue Sep 4, 2019 · 4 comments

Comments

@luran813
Copy link

luran813 commented Sep 4, 2019

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)                                                                                                                 
@shastox
Copy link

shastox commented Sep 26, 2019

Нужно добавить steps в этот файл: https://github.com/framework7io/framework7-template-webpack/blob/master/src/template7-helpers-list.js

@kriboogh
Copy link
Contributor

kriboogh commented Jul 1, 2020

I also get this error:

  • defined the method name in template7-helpers-list.js: ['helper']
  • registered the method in app.js before the app = new Framework7(...) call
  • template is a f7.html file for a routable tab: {{helper param}}

Also get the missing helper error when opening the tab (framework 5.7.8)

@shastox
Copy link

shastox commented Jul 1, 2020

Нужно перезапустить webpack

@kriboogh
Copy link
Contributor

kriboogh commented Jul 2, 2020

Already did that (several times), doesn't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants