Vue combined with Grapejs

Currently, I am utilizing Grapejs with Vue and everything appears to be functioning properly. However, I am encountering an issue with the "grapesjs-preset-webpage" library.

I am struggling to incorporate additional HTML options, such as "Columns", "Videos", and other settings that are visible when using the CDN.

My main query is how can I include more blocks beyond the default 3 that already exist? (link-block, quote, text-basic).

In my configuration file, the setup looks like this:

<script>
  import grapesjs from 'grapesjs'
  import 'grapesjs/dist/css/grapes.min.css'
  import 'grapesjs/dist/grapes.min.js'
  import plugin from 'grapesjs-preset-webpage';

  export default {
   name: 'BuilderHtml',
  
   mounted(){
     grapesjs.init({
       container: '#gjs',
       height: '900px',
       width: '100%',
       plugins: [plugin],        
       storageManager: {
         id: 'gjs-',
         type: 'local',
         autosave: true,
         storeComponents: true,
         storeStyles: true,
         storeHtml: true,
         storeCss: true,
       },
       deviceManager: {
         devices:
         [
           {
             id: 'desktop',
             name: 'Desktop',
             width: '',
           },
           {
             id: 'tablet',
             name: 'Tablet',
             width: '768px',
             widthMedia: '992px',
           },
           {
             id: 'mobilePortrait',
             name: 'Mobile portrait',
             width: '320px',
             widthMedia: '575px',
           },
         ]
       },
       pluginsOpts: {
         [plugin]: {
            blocksBasicOpts: {
                blocks: ['column1', 'column2', 'column3', 'column3-7', 'text', 'link', 'image', 'video'],
                flexGrid: 1,
           },          
           blocks:['link-block', 'quote', 'text-basic', 'column3'],
         },
       }
     })
   }
  }
  </script>

Despite my efforts to include the configuration above, no new block is displaying. Have I made an error somewhere? https://i.sstatic.net/r3Rmc.png

Answer №1

If you want to incorporate additional elements, you have the option of utilizing the grapesjs-blocks-advanced extension or setting up personalized blocks.

import grapesjsblocks from 'grapesjs-blocks-advanced'

plugins: [grapesjsblocks],
  pluginsOpts: {
    "gjs-blocks-advanced": {},
  }

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Set up an event listener for when geolocation permission is approved

My Setup: I've written some basic code snippet below: const onSuccess = () => { console.log('success'); } const onError = () => { console.log('error'); } navigator.geolocation.getCurrentPosition(onSuccess, onError) ...

Using Selenium WebDriver with JavaScript: Handling Mouse Events (mouseover, click, keyup) in Selenium WebDriver

I am currently working on integrating Selenium testing for mouse events with dynamically generated elements. Specifically, I am attempting to trigger a "mouseover" event on an element and then interact with some icons within it. However, I have encountere ...

Issue with Webpack: Unable to import Vue from an instance stored in a different folder

Currently, I am in the process of integrating Vue.js into a Django project that is a multi-page application. The main objective is to divide the frontend code across the various apps within the project. Unfortunately, I have encountered an issue where I a ...

Vue Django application access denied: CSRF verification failed

It seems like I have encountered a Django issue with the backend system. My Vue code is located in frontend/ (127.0.0.1:8080) while the Django code resides in backend/ (127.0.0.1:8000). I have carefully followed the instructions provided by Django regardin ...

Is it possible to retrieve an object based on a variable value?

This seems like a simple problem... I possess an object const VR03 = { name: "Eternal Growth Ring", price: "2500" } Within a function, I am assigning a string to a variable function myFunction(){ let js_type = jQuery('#type').val( ...

What criteria does a PHP function need to meet in order to be considered valid for use with AJAX and PHP?

My website includes an input field that undergoes real-time checking via AJAX requests to inform users if their input is valid or not. Upon submission, the input must be rechecked to ensure it meets the same criteria as checked by AJAX (in case JavaScript ...

What is the best way to use jQuery to set the height of one div equal to another div

Edited: I am facing a situation with a 3-column layout - Column A, Column B, Column C. The height of Column A is dynamic and I need to set the same height for both Column B and C. For instance, Column A contains a tabbed panel with varying heights based ...

My experience with the Vue.js program has been disappointing as it is failing

Below is an example of my Vue.js code: <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport&quo ...

Guidelines on maintaining an active getSelection with JavaScript

I need help figuring out how to change the font size of selected text within a div without losing the highlight/selection when I click a button. Can someone assist me in keeping the text highlighted while also resizing it upon clicking the button? ...

Can getServerSideProps be adjusted to avoid triggering a complete page reload after the first load?

My server-rendered next.js app consists of a 3-page checkout flow. The first page involves fetching setup data like label translations and basket items within the getServerSideProps function, as shown below: UserDetails.js import React from 'react&apo ...

Run a function after all xmlHttpRequests have finished executing

OVERVIEW My website relies on an API to fetch data, making multiple post and get requests to a server upon opening. While we know how long each individual call takes, determining the total time for all calls to complete is challenging. SCENARIO For inst ...

Preventing the reoccurrence of function events

I need to create an event triggered by a mouse click when the user clicks a button. The code snippet below shows my attempt, but I'm facing an issue where the function continues to run if the user clicks on a second input field after the initial one: ...

How can I create a script for a sliding/toggling menu?

Not sure if it's appropriate to ask, but I'm currently in search of a slide/toggle menu. Despite my efforts on Google, I haven't been able to find exactly what I need. As someone who is more skilled in HTML/CSS than jQuery or other scripting ...

display elements in indexed alphabetical order

Is it possible to format the $index output in alphabetical order instead of numerical? <div ng-repeat="name in names">{{$index}}</div> I am wondering if this can be achieved. ...

Adjust the location of the slider scrollbar in jQuery UI

Currently, I am implementing jQuery UI's slider scrollbar and my goal is to set its position upon page load. Although I have referred to the sample code provided, my experience with jQuery UI is limited, so I am unsure about the necessary modification ...

The functionality to show the login status is currently malfunctioning

I have a login status indicator section on my homepage which is connected to an ajax-php database. The login button performs two actions when clicked. <input value="Login" type="button" onclick='logInUser(/*function to handle login request*/);upda ...

Is it appropriate to use a component inside an entry component?

I'm currently working on a component that triggers a function to open a window: @Component({ selector: 'app-deposits', templateUrl: './deposits.component.html', styleUrls: ['./deposits.component.scss&apo ...

Analyzing Data with Google Analytics in Vue3 Development

After searching extensively, I came up empty-handed when trying to find a simple tutorial or any information on how to integrate Google Analytics data into an admin page on a website. So my question is, how can I retrieve the Google Analytics datasets fr ...

AJAX has caused the webpage to freeze, prompting a warning about potentially slowing down the browser

My website features an AJAX call to the Alpha Vantage API, which retrieves JSON data on stock symbols and tickers as users type in the search box. function handleKeyPress() { var keywords = document.getElementById("TextBox89 ...

Rhino's env.js causes the anchor element's pathname to be undefined

Encountered an issue that appears to be related to how anchor tags are implemented in Rhino. Despite using env.js, there might be a configuration error causing the problem. The issue arises when writing unit tests for code designed for an angularjs applic ...