How to compile jade templates in to JavaScript functions to use them on client side?

后端 未结 6 922
清歌不尽
清歌不尽 2021-01-04 11:31

I want to use compiled jade templates on client side. How should I compile them to get javascript files ? https://github.com/visionmedia/jade

6条回答
  •  醉梦人生
    2021-01-04 12:18

    #coffeescript
    jade = require 'jade'
    data = '#menu'
    options = 
      client: true
      compileDebug: false
    fn = jade.compile data, options
    console.log fn.toString()
    

提交回复
热议问题