buefy
Version:
Lightweight UI components for Vue.js based on Bulma
103 lines (90 loc) • 2.21 kB
JavaScript
Object.defineProperty(exports, '__esModule', { value: true });
var __chunk_6 = require('./chunk-13e039f5.js');
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
var script = {
name: 'BCollapse',
props: {
open: {
type: Boolean,
default: true
},
animation: {
type: String,
default: 'fade'
},
ariaId: {
type: String,
default: ''
}
},
data: function data() {
return {
isOpen: this.open
};
},
watch: {
open: function open(value) {
this.isOpen = value;
}
},
methods: {
/**
* Toggle and emit events
*/
toggle: function toggle() {
this.isOpen = !this.isOpen;
this.$emit('update:open', this.isOpen);
this.$emit(this.isOpen ? 'open' : 'close');
}
}
};
/* script */
const __vue_script__ = script;
/* template */
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"collapse"},[_c('div',{staticClass:"collapse-trigger",on:{"click":_vm.toggle}},[_vm._t("trigger",null,{open:_vm.isOpen})],2),_vm._v(" "),_c('transition',{attrs:{"name":_vm.animation}},[_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.isOpen),expression:"isOpen"}],staticClass:"collapse-content",attrs:{"id":_vm.ariaId,"aria-expanded":_vm.isOpen}},[_vm._t("default")],2)])],1)};
var __vue_staticRenderFns__ = [];
/* style */
const __vue_inject_styles__ = undefined;
/* scoped */
const __vue_scope_id__ = undefined;
/* module identifier */
const __vue_module_identifier__ = undefined;
/* functional template */
const __vue_is_functional_template__ = false;
/* style inject */
/* style inject SSR */
var Collapse = __chunk_6.__vue_normalize__(
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
__vue_inject_styles__,
__vue_script__,
__vue_scope_id__,
__vue_is_functional_template__,
__vue_module_identifier__,
undefined,
undefined
);
var Plugin = {
install: function install(Vue) {
__chunk_6.registerComponent(Vue, Collapse);
}
};
__chunk_6.use(Plugin);
exports.Collapse = Collapse;
exports.default = Plugin;
;