grapesjs icon indicating copy to clipboard operation
grapesjs copied to clipboard

Before you drag and drop the image,there was nothing in assetManager

Open ionic666 opened this issue 8 years ago • 6 comments

qq20180626-104503 and I don't know how to set the backgroundImage

ionic666 avatar Jun 26 '18 02:06 ionic666

@ionic666 you can read Asset API documentation here There is no image in your asset manager. It seems you haven't added it yet. You can add like this..

grapesjs.init({
....
.....
 assetManager: {
          assets: [
                  {
                  type: 'image',
                  src: 'http://via.placeholder.com/250x350/0174DF/ffffff/',
                  date: '2018-06-28',
                  height: 350,
                  width: 250
                    },
                  {
                  type: 'image',
                  src: 'http://via.placeholder.com/250x350/5FB404/ffffff/',
                  date: '2018-06-28',
                  height: 350,
                  width: 250
                    }
            ]
          }
....
....
})

ronaldaug avatar Jun 28 '18 09:06 ronaldaug

@ronaldaug tim 20180628171659 i have done it.but I mean that if i haven't drag the image component,I cannot set background images for other components. The official demo was also not available

ionic666 avatar Jun 28 '18 09:06 ionic666

Maybe, you didn't add the component type as image. Make sure you add it. And you can just double click on the image to trigger the assets images box.

Could you share your codes via codepen or jsfiddle?

Do you mean this official demo ? I can see the images under Flex is the new black section do not work. It's because the images were added via CSS codes.

ronaldaug avatar Jun 28 '18 09:06 ronaldaug

i am sorry.i have the component for image. when i use the component for image,there will be ok. but i just want to change the background-image for other element before i open the assets. qq 20180628195823 qq 20180628195838 you can try to change it first when you have not drag the image

ionic666 avatar Jun 28 '18 11:06 ionic666

@ionic666 you can change the background-image from the style manager. And again @ionic666 you HAVE TO follow the issue template otherwise you're making us waste our time to understand what you asking

artf avatar Jun 30 '18 12:06 artf

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar Sep 17 '19 11:09 lock[bot]