0.2.7 • Published 4 years ago
vue-block-editor v0.2.7
vue-block-editor
Block editor with collumns and JSON output for Vue.js and Nuxt.js
Responsive design
Install
Vue.js
npm i vue-block-editor
In main.js:
import editor from "vue-block-editor";
Vue.component("app-editor", editor);
Nuxt.js
npm i vue-block-editor
In folder 'plugins' create file editor.js
In editor.js:
import Vue from "vue";
import editor from "vue-block-editor";
Vue.component("app-editor", editor);
In nuxt.config.js:
plugins: [{ src: "@/plugins/editor", ssr: false }],
Usage
<template>
<div style="width: 800px;">
<h1>VUE-BLOCK-EDITOR</h1>
<app-editor :language="ru_RU" ref="editor" @save="on_save_method" @onChange="on_change_method" />
</div>
</template>
<script>
export default {
methods: {
on_save_method(value) {
console.log(value);
},
on_change_method(value) {
console.log(value);
}
},
mounted() {
this.$refs.editor.save();
}
};
Init data
<template>
<div style="width: 800px;">
<h1>VUE-BLOCK-EDITOR</h1>
<app-editor :initData="initData" ref="editor" @save="on_save_method" @onChange="on_change_method" />
</div>
</template>
<script>
export default {
data() {
return {
initData: '{"blocks":[{"type":"paragraph","content":"Init paragraph text"},{"type":"quotes","content":"Init data quote","author":"Some Author"}]}'
}
},
methods: {
on_save_method(value) {
console.log(value);
},
on_change_method(value) {
console.log(JSON.stringify(value));
}
}
}
</script>
Git repo
https://gitlab.com/tehnokom/vue-block-editor
Customize configuration
In prop "language" you can choose one of two languages: English(en_GB), Russian(ru_RU)
0.2.7
4 years ago
0.2.5
5 years ago
0.2.4
5 years ago
0.2.3
5 years ago
0.2.2
5 years ago
0.2.1
5 years ago
0.2.0
5 years ago
0.1.18
5 years ago
0.1.17
5 years ago
0.1.15
5 years ago
0.1.14
5 years ago
0.1.13
5 years ago
0.1.12
5 years ago
0.1.11
5 years ago
0.1.10
5 years ago
0.1.9
5 years ago
0.1.8
5 years ago
0.1.7
5 years ago
0.1.6
5 years ago
0.1.5
5 years ago
0.1.4
5 years ago
0.1.3
5 years ago
0.1.2
5 years ago
0.1.1
5 years ago
0.1.0
5 years ago