@nextcloud/vue
Version:
Nextcloud vue components
27 lines (26 loc) • 526 B
JavaScript
const ActionGlobalMixin = {
beforeUpdate() {
this.text = this.getText();
},
data() {
return {
// $slots are not reactive.
// We need to update the content manually
text: this.getText()
};
},
computed: {
isLongText() {
return this.text && this.text.trim().length > 20;
}
},
methods: {
getText() {
return this.$slots.default?.()[0].children?.trim?.() || "";
}
}
};
export {
ActionGlobalMixin as A
};
//# sourceMappingURL=actionGlobal-BZFdtdJL.mjs.map