We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi, this example for VueJS. May be need for community. I's work for me.
Componet editor
<template> <article> <textarea :id="id"></textarea> </article> </template> <script> import SirTrevor from 'sir-trevor/build/sir-trevor'; import icon from 'sir-trevor/build/sir-trevor-icons.svg'; export default { name: 'c-editor', props: { id: { type: String, default: 'js-st-instance' } }, data() { return { el: null, editor: null }; }, methods: { save() { this.editor.onFormSubmit(); }, update(value) { this.el.value = value; this.editor.reinitialize(); } }, mounted() { this.el = document.getElementById(this.id); if (!this.el) return false; this.editor = new SirTrevor.Editor({ el: this.el, defaultType: ['Text', 'Image'], iconUrl: icon }); } }; </script>
Page
<template> <div> ....................... other form ...................... <c-editor ref="editor"></c-editor> <b-button @click="bSave()"> Save </b-button> </div> </template> <script> export default { data() { return {}; }, methods: { bSave() { if (this.$refs.editor) { this.$refs.editor.save(); this.model._data.text.ru = JSON.stringify(this.$refs.editor.editor.store.retrieve()); } } }, updated() { if (this.$refs.editor) this.$refs.editor.update(this.model._data.text); } }; </script>
I not found event "watch live data" to make this.$emit() simple code.
The text was updated successfully, but these errors were encountered:
This is the correct way to get and restore data for now.
Sorry, something went wrong.
I also saw someone had submitted a couple of prs:
editor.restore(data) and editor.getData() which does what you are looking for so i'll merge those into the next release.
editor.restore(data)
editor.getData()
Thank. It will be wonderful.
No branches or pull requests
Hi, this example for VueJS. May be need for community. I's work for me.
Componet editor
Page
I not found event "watch live data" to make this.$emit() simple code.
The text was updated successfully, but these errors were encountered: