Issue with css and icons
@raghuv9 creating a custom vue component for grapesjs: and to actually use it: check this repo for more info. cheers!
Read full answer below ↓Question
hey @artf i installed grapes js through npm [ "grapesjs": "^0.15.9"] and i'm using vue with grapes js , here is my code
------------------------------------------------------------------------------------------------------------
import grapesjs from 'grapesjs';
import 'grapesjs/dist/css/grapes.min.css';
export default {
data() {
return {
editor: null
}
},
methods: {
change() {
this.$emit('change', this.editor.getHtml());
},
},
mounted() {
this.editor = grapesjs.init({
container : '#gjs'
})
this.editor.on('change', this.change);
}
}
i'm having issues with css as few icons are missing and remaining icons are not responding to any action. and there are no errors when i run npm and no errors in the browser console too.
os-windows10 , node-13.0.1,npm:6.13.0
**This how my ui looks like**
Answers (1)
@raghuv9 creating a custom vue component for grapesjs:
import grapesjs from 'grapesjs'
const VueGrapesjs = {
install (Vue, options = {}) {
const config = {
presets: []
}
const { presets } = Object.assign(config, options)
if (presets.length) {
presets.forEach((data) => {
const {
name,
options = {},
loader
} = data
grapesjs.plugins.add(name, (editor) => {
loader(editor, options)
})
})
}
Vue.prototype.$grapesjs = grapesjs
}
}
export default VueGrapesjs
and to actually use it:
<template>
<div id="app">
<grapesjs
:options="gjsConfigs"
/>
</div>
</template>
<script>
export default {
name: 'app',
data () {
return {
gjsConfigs: {
plugins: ['charts']
}
}
}
}
</script>
check this repo for more info. cheers!
Related Questions and Answers
Continue research with similar issue discussions.
Issue #2262
blocked by cors policy No 'Access-Control-Allow-Origin' header is present on the requested resource
hello i'm using grapesjs with vue wrapper i'm unable to load a webpage using urlLoad: of grapesjs im facing cors issue,i'm pretty new to gr...
Issue #3534
npm run build error
npm run build gives error @version 0.17.3../../lib/codemirror in ./src/editor/dist/grapes.min.js../css/css in ./src/editor/dist/grapes.min....
Issue #3404
Style Manager Issue.
Hi @artf I want to hide and show style properties for specific component. After referencing this issue https://github.com/artf/grapesjs/iss...
Issue #1686
CMS: Grapesjs is not defined
I am trying to use basic Grapesjs editor to CMS. Here's my code: I have installed the grapesjs using NPM. Later I tried running this html f...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins →Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.
Browse premium plugins →Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.