2.0 rc-7 toString() expression not works inside mustache {{}}
See original GitHub issueHello ! I am very new Vue. Sorry if I miss something in documentation.
I have a very simple template witch is not working as expected. I do not know exactly context of this.toString() but it is not vm.$data.
<div id="app">
{{ this.toString() }} <!--should return $data.toString() but not works -->
</div>
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Mustache.java should not fail when tostring of an object ...
test case: public static class ObjectWithPropertyWithNullToString { public Object property = new Object() { @Override public String ...
Read more >How to ignore a handlebars expression in Mustache templates?
Needless to say there is no actual way to escape them. The trick is to just emit a string value of handlebars. Share....
Read more >WhatsNew 2.0 | Ktor Framework
i upload my ktor project to heroku server and succeffly upload and it work only for simple request put when it go inside...
Read more >Logic-less templates. - mustache(5)
It works by expanding tags in a template using values provided in a hash or object. We call it "logic-less" because there are...
Read more >Introduction to Mustache - Baeldung
Mustache is a logicless template engine for creating dynamic content like HTML, configuration files among other things. 2. Introduction.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@LinusBorg
It actually has… so it can access methods,
$options
etc.$data
is onthis
, so the docs were correct. http://jsfiddle.net/r9kojstk/Since
this
is an object (that didn’t overridetoString
), usingthis.toString()
simply gives[object Object]
, which is expected.the template has not
this
context.It simply has access to all properties and methods of the vm as variables. $data is one of those properties.
to get a nice format, simply use a
<pre>
element: