Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <template>
- <div>
- <textarea class="form-control question-create-editor" id="question_description" placeholder="Go wild with all the details here - make image upload work" rows="3">
- </div>
- </template>
- <script>
- export default {
- props: ['redactorValue'],
- mounted: function(){
- $('#question-create-form .question-create-editor').redactor({
- imageUpload:'/urlGoesHereBro/',
- plugins: ['video', 'imagemanager', 'counter', 'limiter'],
- buttonsHide:['html', 'formatting', 'deleted', 'indent', 'outdent', 'alignment', 'horizontalrule']
- });
- },
- computed: {
- redactorValue: function(){
- $('#question-create-form .redactor-editor').on('keyup', function(){
- var textContent = $('#question-create-form .redactor-editor').html();
- console.log( 'textContent = ' + textContent );
- this.$emit('redactorValue', textContent);
- });
- }
- }
- };
- <vueredactor></vueredactor>
- export default {
- data(){
- return {
- redactorValue: null
- }
- },
- mounted: function(){
- $('#question-create-form .question-create-editor').redactor({
- imageUpload:'/urlGoesHereBro/',
- plugins: ['video', 'imagemanager', 'counter', 'limiter'],
- buttonsHide:['html', 'formatting', 'deleted', 'indent', 'outdent', 'alignment', 'horizontalrule']
- });
- $('#question-create-form .redactor-editor').on('keyup', function(){
- this.redactorValue = $('#question-create-form .redactor-editor').html();
- }.bind(this));
- }
- };
- <template>
- <div>
- <textarea class="form-control question-create-editor" id="question_description" placeholder="Go wild with all the details here - make image upload work" rows="3">
- </div>
- </template>
- <script>
- export default {
- props: ['value'],
- data(){
- return {
- redactorValue: null
- }
- },
- mounted: function(){
- $('#question-create-form .question-create-editor').redactor({
- imageUpload:'/urlGoesHereBro/',
- plugins: ['video', 'imagemanager', 'counter', 'limiter'],
- buttonsHide:['html', 'formatting', 'deleted', 'indent', 'outdent', 'alignment', 'horizontalrule']
- });
- $('#question-create-form .redactor-editor').on('blur', function(){
- this.redactorValue = $('#question-create-form .redactor-editor').html();
- this.$emit('input', this.redactorValue);
- }.bind(this));
- }
- };
- </script>
- Vue.component('vueredactor', require('./components/redactor.vue'));
- var App = new Vue({
- el: '#app',
- data: {
- redactorContent: null
- }
- });
- <div id="app>
- <vueredactor v-model="redactorContent"></vueredactor>
- </div>
Add Comment
Please, Sign In to add comment