fis3 icon indicating copy to clipboard operation
fis3 copied to clipboard

模块化组件中的__inline方法在编译阶段报错

Open KkkkKernc opened this issue 8 years ago • 5 comments

  • Node版本: v6.11.2
  • FIS版本: v3.4.33
  • 依赖插件: "fis3-hook-commonjs": "^0.1.26",

你好, 我想在一个设置了isMod: true的js文件中使用inline方法获得一个html模版文件,结果在编译阶段报了如下的错误:

 [ERROR] standard.builtin: Parse Error: Line 39: Unexpected token ILLEGAL [/Users/Kernc/Documents/cube23/community_web/source/components/login_modal/login_modal.js]

引用代码就是这样的一句:

const login_modal = __inline('./login_modal.tpl');

因为我也没看到有说过不能在模块化的组件中使用inline方法,是我的使用方法有错误吗? THX~

KkkkKernc avatar Sep 06 '17 03:09 KkkkKernc

模板里面有bug?

oxUnd avatar Sep 06 '17 04:09 oxUnd

@xiangshouding 并没有呀 之前完全用模版引入的方式也没有问题 以及我想获取编译后的路径,使用__uri方法也会报同样错

KkkkKernc avatar Sep 06 '17 05:09 KkkkKernc

贴代码上来吧,以及贴一下配置文件,fis3 版本等等。

(●ω●) [email protected]于2017年9月6日周三 下午1:29写道:

并没有呀 之前完全用模版引入的方式也没有问题

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/fex-team/fis3/issues/1189#issuecomment-327378916, or mute the thread https://github.com/notifications/unsubscribe-auth/AAmhmxyIU57vXyiPR4SiZqapEwAoUqw6ks5sfi3FgaJpZM4PNy2F .

oxUnd avatar Sep 07 '17 00:09 oxUnd

最近使用fis3,碰到了同样的问题。不知道是怎么解决的

longmore avatar Jul 23 '19 09:07 longmore

要对 tpl 做处理,经过 parser 后转成 js 代码,然后才能 inline 进去才有意义,否则 inline 一堆 html 片段 自然会报错

2betop avatar Jul 23 '19 09:07 2betop