I am trying to preview input of form to another div as html markdown.
<div class="form-group" id="form">
{!! Form::open(['route' => 'post.create']) !!}
{{ Form::text('title', 'title', ['class' => 'form-control']) }}
{{ Form::hidden('category_id', $category->id) }}
{{ Form::textarea('body', 'body', ['class' => 'form-control', 'v-model' => 'input']) }}
<div><?php echo '{{{ output }}}'; ?></div>
{{ Form::submit('send', ['class' => 'btn btn-sm btn-default btn-block']) }}
{!! Form::close() !!}
</div>
On app.js:
const app = new Vue({
el: '#form',
data: {
input: '',
output: ''
},
watch: {
input: function(val) {
this.output = marked(val);
}
}
});
@{{{ output }}}} returns the same result which is blank page with error on console:
- invalid expression: Unexpected token ) in
_s({ output)+"}"
Raw expression: {{{ output }}}
@{{{ output }}}as everyone else suggests