Skip to content
This repository has been archived by the owner on May 25, 2018. It is now read-only.

More control over modal contents and issues with inline-template #19

Closed
andrewdavidcostello opened this issue Oct 14, 2015 · 7 comments
Closed

Comments

@andrewdavidcostello
Copy link

I have posted it on the laracasts forum post here for reference:

https://laracasts.com/discuss/channels/general-discussion/vuestrap-bootstrap-components-built-with-pure-vuejs?page=3#reply-106358

Essentially would be great to have multiple insertion points or full support for inline-template.

When I used inline-template it only left some of my template intact and tried to replace/remove other items.

@yuche
Copy link
Owner

yuche commented Oct 14, 2015

See new modal components with custom template. http://yuche.github.io/vue-strap/#modal

@andrewdavidcostello
Copy link
Author

I had to delete my node modules and reinstall as an update didn't work.

After updating the custom templates work perfectly! Thanks for sorting so quickly, now I can work on ditching jQuery and bootstrap.

@kamal-chagam
Copy link

@andrewdavidcostello I have this error Browserify Failed!: 'import' and 'export' may appear only with 'sourceType: module' .
I did window.VueStrap = require('vue-strap'); // i tried even full path also
new Vue ({
components:{
alert : VurStrap.alert;
})

what is the mistake I did ?

@yuche
Copy link
Owner

yuche commented Oct 15, 2015

@chagamkamalakar
Try:

var alert = require('vue-strap/src/Alert.vue');

@kamal-chagam
Copy link

@yuche
now the error is as follows..
Browserify Failed!: Parsing file /../../../node_modules/vue-strap/src/Alert.vue: 'import' and 'export' may appear only with 'sourceType: module' ..

@andrewdavidcostello
Copy link
Author

@chagamkamalakar You are probably experiencing this issue?

#13

To get around this I use

window.VueStrap = require('vue-strap/dist/vue-strap.min.js');

components: {
        // Bootstrap
        'alert': VueStrap.alert,
        'datepicker': VueStrap.datepicker,
        'modal': VueStrap.modal,
        'panel': VueStrap.panel,

Not a nice solution but it works for now.

@kamal-chagam
Copy link

@andrewdavidcostello
when i tried earlier .. it was complied with no error. but alert box is displayed like normal text .. i coded as bellow

in main.js file i did like

window.VueStrap = require('vue-strap/dist/vue-strap.min.js');

list.template.js

<div>
    <h2>Hotel listing</h2>
    <table class="table table-responsive table-bordered">
        <tr>
            <th>Name</th>
            <th>Latest Booked</th>
        </tr>
    </table>
    <button class="btn btn-default btn-lg"
            v-on="click:showRight = !showRight">
        Click to toggle alert on right
    </button>
    <alert
            show="{{@showRight}}"
            duration="3000"
            type="success"
            width="400px"
            placement="top-right"
            dismissable>
        <span class="icon-ok-circled alert-icon-float-left"></span>
        <strong>Well Done!</strong>
        <p>You successfully read this important alert message.</p>
    </alert>
</div>

list.js

module.exports = {
    template: require('./list.template.html'),

    components: {
        'alert': VueStrap.alert 
    },

    data: function() {
        return {
            showRight: false,
            showTop: false
        }
    }
}

It's not working, what it went wrong

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants