I'm trying to integrate tinymce vue component to my laravel project. this is what i did so far:
installed the Vue package:
$ npm install --save @tinymce/tinymce-vue
include this script after your :
<script src="/path/to/tinymce.min.js"></script>
Create a new Vue component Editor.Vue within resources/assets/js/components:
<template>
<div id="app">
<img alt="Vue logo" src="./assets/logo.png">
<editor
api-key="no-api-key"
:init="{
height: 500,
menubar: false,
plugins: [
'advlist autolink lists link image charmap print preview anchor',
'searchreplace visualblocks code fullscreen',
'insertdatetime media table paste code help wordcount'
],
toolbar:
'undo redo | formatselect | bold italic backcolor | \
alignleft aligncenter alignright alignjustify | \
bullist numlist outdent indent | removeformat | help'
}"
/>
</div>
</template>
<script>
import Editor from '@tinymce/tinymce-vue'
export default {
name: 'app',
components: {
'editor': Editor
}
}
</script>
Registered the component in resources/assets/js/app.js:
Vue.component('editor', require('./components/Editor.vue'));
installed it:
npm run dev
I'm not sure about:
- how do I use the component in my blade?
- how do I integrate it into a textarea so I can just submit the form from the blade and use the inputs in my controller?