Closed axelitus closed 6 years ago
I created my custom markdown editor based on this one, but I think it needs this feature. I've managed to do the following:
<markdown-editor name="content" :value="{{ json_encode($content) }}"></markdown-editor>
I added prop name
as String and on the initialize
method I added this at the beginning:
if (this.name) {
this.$el.firstElementChild.setAttribute('name', this.name);
}
I don't know if this is the best way to do this, but it is working.
If you want to submit directly, please set forceSync
to true
. SimpleMDE Configuration.
<markdown-editor name="content" :config="{ forceSync: true }"></markdown-editor>
Using v-model
to bind data and using ajax method to send is the normal way.
It does not work for me. I'm doing this:
<markdown-editor name="content" :config="{ forceSync: true }" :value="{{ json_encode($content) }}"></markdown-editor>
When saving the form (via post request), the content is never sent.
Sorry, it should be configs
and please update to 0.4.9
for the name
prop support.
<markdown-editor name="content" :configs="{ forceSync: true }" :value="{{ json_encode($content) }}"></markdown-editor>
I'm using vue-simplemde with Laravel and so far it works great, the only issue is that when I submit the form, no data is passed through the POST action.
I'm really new with Vue so I don't know if I'm doing something wrong, but I think this is because the template contains a textarea without a name attribute, so no data is passed along. I think it would be nice to have a prop that sets the name of the textarea so that it can be set to whatever is expecting the form processing script page. For example:
This would render the following code: