@nextcloud/vue
Version:
Nextcloud vue components
2 lines (1 loc) • 492 B
JavaScript
;const t=require("vue"),e={before(){(!this.$slots.default||this.text.trim()==="")&&(t.util.warn(`${this.$options.name} cannot be empty and requires a meaningful text content`,this),this.$destroy(),this.$el.remove())},beforeUpdate(){this.text=this.getText()},data(){return{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=e;