Can I pass a variable in a template binding?

前端 未结 4 568
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-15 10:45

I know this isn\'t a good method to use long term, but for troubleshooting, is there any way I can pass a simple string while binding a template and then access it as a variable

4条回答
  •  被撕碎了的回忆
    2021-02-15 11:18

    You can supply a data parameter to the template binding and define an object literal if you want just like you are doing:

    
    

    instead do this:

    
    

    http://knockoutjs.com/documentation/template-binding.html

提交回复
热议问题