ctf0 / Laravel-Media-Manager

A "Vuejs & Laravel" Media Manager With Tons of Features
MIT License
832 stars 181 forks source link

error trying the example with modal #140

Closed gmlo89 closed 4 years ago

gmlo89 commented 4 years ago

I am trying to test the example with modal, but I get the following error:

Captura de Pantalla 2020-03-05 a la(s) 23 15 55

ExampleComp.vue

<template>
</template>
<script>
import MediaModal from './../../../assets/vendor/MediaManager/js/mixins/modal'
//import MediaModal from './path/to/vendor/MediaManager/js/mixins/modal' ../assets/vendor/MediaManager/js/manager

export default {
    name: 'media-manager',
    mixins: [MediaModal],

    // the inputs we want to use the manager for
    // in our case they are the article 'cover' & 'gallery'
    // for multi-selected files links "https://github.com/ctf0/Laravel-Media-Manager/issues/40#issuecomment-382416243"
    // 
    // for usage with an editor "wysiwyg" only, you dont need this part 
    data() {
        return {
            cover: '',
            gallery: '',
            links: ''
        }
    },
    mounted(){
         //     $('.__Inmodal-editor-hide').click()

    }
}
</script>

Vue.component('ExampleComp', require('./Utils/ExampleComp.vue').default);

On view:

<example-comp inline-template>
    <div>
        {{-- manager --}}
        <div v-if="inputName">@include('MediaManager::extras.modal')</div>

        {{-- items selector --}}
        <media-modal item="cover" :name="inputName"></media-modal>
        <media-modal item="gallery" :name="inputName" type="folder"></media-modal>
        <media-modal item="links" :name="inputName" :multi="true"></media-modal>

        {{-- for editor --}}
        @include('MediaManager::extras.editor')

        {{-- form --}}
        <form action="..." method="...">
            {{-- cover --}}
            <section>
                <img :src="cover">
                <input type="hidden" name="cover" :value="cover"/>
                <button type="button" @click="toggleModalFor('cover')">select cover</button>
            </section>

            {{-- gallery --}}
            <section>
                <input type="text" name="gallery" :value="gallery"/>
                <button type="button" @click="toggleModalFor('gallery')">select gallery folder</button>
            </section>

            {{-- links --}}
            <section>
                <input v-for="item in links"
                    :key="item"
                    :value="item"
                    type="text" 
                    name="links[]"/>

                <button type="button" @click="toggleModalFor('links')">select gallery links</button>
            </section>

            // ...
        </form>
</div>
</example-comp>

thanks!

ctf0 commented 4 years ago

can u make a repo for me to test with ?

gmlo89 commented 4 years ago

Hi, it was my mistake. I had the wrong name of my component. but now I have the problem of styles like this:

Captura de Pantalla 2020-03-06 a la(s) 11 44 17
gmlo89 commented 4 years ago

My mistake again .. I already saw that I had not added the assets / vendor / MediaManager / style.css styles.   Thank you, your project is great.