Comments (6)
Adding this here as it is the only relevant google result atm for bulma extensions and Vue and maybe it will help the next person searching on this. In order to use bulma-extensions with Vue, you need to create a data element to store the results of your attach call in, so that Vue will be aware of the reactiveness inside of the virtual DOM, and then wait for the component to be mounted before actually calling the relevant bulma extension's attach function. An example script section of a component using bulma accordion:
<script>
import bulmaAccordion from 'bulma-extensions/bulma-accordion/dist/js/bulma-accordion.min.js'
import 'bulma-extensions/bulma-accordion/dist/css/bulma-accordion.min.css';
export default{
data () {
return{
accordions : []
}
},
mounted: function() {
this.accordions = bulmaAccordion.attach()
},
name: 'myComponentName',
}
</script>
You can import the css globally instead, but the javascript must be imported at the component level.
from bulma-extensions.
Please follow documentation at: https://wikiki.github.io/
from bulma-extensions.
Hi,
did you tried:
npm install sass-loader --save-dev
and
npm install --save-dev node-sass
from bulma-extensions.
And how should I include these all files to my project? I'm trying -
Import bulma from 'bulma-extentions'
from bulma-extensions.
window.Vue = require('vue');
import Buefy from 'buefy';
import {bulmaAccordion,bulmaSteps} from 'bulma-extensions/dist/js/bulma-extensions.min';
Vue.use(Buefy, {
defaultIconPack: 'fas',
});
const app = new Vue({
el: '#app',
mounted:function(){
bulmaAccordion.attach();
bulmaSteps.attach();
}
});
from bulma-extensions.
This is an example of Vue component I've wrote for a project, which wraps bulma-carousel. You could extend it for any other bulma-extension. It encapsulates each bulma-carousel instance individually, so there's no need to use those bulmaExtension.attach()
static methods.
(NOTE: This example depends on another component I've written for bulma-carousel navigation buttons, but it's omitted here).
<template>
<div
ref="thisCarousel"
:class="[{
'carousel': !hero
}, {
'hero-carousel': hero
}, {
'carousel-animated': animation === 'slide' || animation === 'fade'
}, {
'carousel-animate-slide': animation === 'slide'
}, {
'carousel-animate-fade': animation === 'fade'
}]"
:data-size="size > 1"
:data-autoplay="autoplay"
:data-delay="delay"
>
<div class="carousel-container">
<slot/>
</div>
<McbCarouselNavigation layout="overlay"/>
</div>
</template>
<script>
import BulmaCarousel from 'bulma-carousel/dist/js/bulma-carousel.min'
import McbCarouselNavigation from '../molecules/McbCarouselNavigation'
export default {
name: 'McbCarousel',
components: {
McbCarouselNavigation
},
props: {
hero: {
type: Boolean,
default: false
},
animation: {
type: String,
default: 'slide'
},
autoplay: {
type: Boolean,
default: false
},
delay: {
type: Number,
default: 5000
},
size: {
type: Number,
default: 1
}
},
data () {
return {
bulmaExtensions: {}
}
},
mounted () {
this.bulmaExtensions.carousel = new BulmaCarousel(this.$refs.thisCarousel)
}
}
</script>
from bulma-extensions.
Related Issues (20)
- Bulma steps
- Update checkradio version
- Unrecognized text Switch
- Quickview additional variables
- bulma-slider is out-of-date and doesn't compile
- datetimepicker-clear-button in bulma-calendar submits a form HOT 4
- Bulma FormValidation
- Timeline not working for me
- Flip tooltips to other positions when near the edge of viewport HOT 1
- Options are not working when using bulma calendar
- Bulma Collapsible HOT 1
- bulma-switch.min.css has sass variables
- Unable to use bulma-carousel
- [Feature Request] Organizational or tree chart
- Using Bulma Extensions with Gatsby
- Pulling "bulma-slider" v1.0.4 instead of latest one
- Tooltip cropped in table-container HOT 1
- Tooltip not displaying HOT 2
- [CHECKBOX] RTL also reverses switch direction
- Activate tooltip on :hover only (not on :focus) ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bulma-extensions.