@nextcloud/vue
Version:
Nextcloud vue components
25 lines (24 loc) • 509 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 ? this.$slots.default[0].text.trim() : "";
}
}
};
exports.ActionGlobalMixin = ActionGlobalMixin;