这可能是在 Laravel 中为 Vuejs 编译 js 的方式,但这就是问题所在。
我有像这样使用的 GrapesJs javascript 包
<template>
<div class="base">
<div id="gjs">
<h1>Hello World Component!</h1>
</div>
<!-- <div id="blocks"></div> -->
</div>
</template>
<script>
import grapesjs from "grapesjs";
import greapejspreset from "grapesjs-preset-webpage";
export default {
data() {
return {
editor: null,
};
},
mounted() {
this.editor = grapesjs.init({
// Indicate where to init the editor. You can also pass an HTMLElement
container: "#gjs",
// Get the content for the canvas directly from the element
// As an alternative we could use: `components: '<h1>Hello World Component!</h1>'`,
fromElement: true,
// Size of the editor
height: "1000px",
width: "auto",
// Disable the storage manager for the moment
storageManager: false,
// Avoid any default panel
cssIcons: null,
plugins: [
// 'gjs-blocks-basic',
greapejspreset,
],
this.editor.command("open-blocks");
});
},
};
</script>
如果我在 vue 文件之外有相同的示例,则单击图标有效,但在这种情况下,当我单击下面的任何图标时,它不会触发任何内容,就像这些事件被 vuejs 阻止一样
请帮忙!!!