Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v-model directive on <div contenteditable> #1670

Closed
bdedardel opened this issue Nov 2, 2015 · 3 comments
Closed

v-model directive on <div contenteditable> #1670

bdedardel opened this issue Nov 2, 2015 · 3 comments

Comments

@bdedardel
Copy link

v-model directive can only be used on textarea o or input elements for now.
It would be nice to use it on 'contenteditable' !

Best regards,
Benjamin

@yyx990803
Copy link
Member

Content editable involves a lot more complexity than input bindings, and it's best to use an external library dedicated to this purpose (e.g. Medium.js), wrapped by a custom directive.

@abdulahkam
Copy link

*sorry @yyx990803 I saw that you close this issue.

Hello @bdedardel
I work with summernote today and found your question.

My solution is you can use summernote's onChange callbacks like so :
let 'program' as my vue instance
and 'detail' as my model in 'program'.

          $('#summernote').summernote({
              onChange: function(contents, $editable) {
                // console.log($editable);
                program.detail = $editable;
              }
            })

I do not know if this is a good way to solve your problem
*most probably you have already got it

@bdedardel
Copy link
Author

@abdulahkam Thanks for your post. I will try this solution, even if summernote does not respond exactly to my needs!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants