@dialpad/dialtone-vue
Version:
Vue component library for Dialpad's design system Dialtone
76 lines (75 loc) • 1.95 kB
JavaScript
import normalizeComponent from "../../_virtual/_plugin-vue2_normalizer.js";
const _sfc_main = {
name: "DtLazyShow",
/******************
* PROPS *
******************/
props: {
/**
* Whether the child slot is shown.
* @values true, false
*/
show: {
type: Boolean,
default: false
},
/**
* A valid Vue enter/leave CSS transition name.
*/
transition: {
type: String,
default: null
},
/**
* Enable/Disable transition animation
* @values true, false
*/
appear: {
type: Boolean,
default: false
}
},
/******************
* DATA *
******************/
data() {
return {
initialized: !!this.show
};
},
computed: {
/**
* Set the css property to false when running tests only.
* Refer to: https://vuejs.org/guide/built-ins/transition.html#javascript-hooks for details about
* transition `css` property
* @returns {boolean}
*/
isCSSEnabled() {
return process.env.NODE_ENV !== "test";
}
},
/******************
* WATCH *
******************/
watch: {
show: function(newValue) {
if (!newValue || this.initialized) return;
this.initialized = true;
}
}
};
var _sfc_render = function render() {
var _vm = this, _c = _vm._self._c;
return _c("transition", _vm._g({ attrs: { "name": _vm.transition, "appear": _vm.appear, "css": _vm.isCSSEnabled } }, _vm.$listeners), [_c("div", _vm._g({ directives: [{ name: "show", rawName: "v-show", value: _vm.show, expression: "show" }] }, _vm.$listeners), [_vm.initialized ? _vm._t("default") : _vm._e()], 2)]);
};
var _sfc_staticRenderFns = [];
var __component__ = /* @__PURE__ */ normalizeComponent(
_sfc_main,
_sfc_render,
_sfc_staticRenderFns
);
const DtLazyShow = __component__.exports;
export {
DtLazyShow as default
};
//# sourceMappingURL=lazy_show.vue.js.map