chore: try use quasar bus
gitea/salix-front/pipeline/pr-dev There was a failure building this commit
Details
gitea/salix-front/pipeline/pr-dev There was a failure building this commit
Details
This commit is contained in:
parent
68994db6ff
commit
65e2f950b9
|
@ -0,0 +1,7 @@
|
|||
import { EventBus } from 'quasar';
|
||||
import { boot } from 'quasar/wrappers';
|
||||
|
||||
export default boot(({ app }) => {
|
||||
const bus = new EventBus();
|
||||
app.provide('remove', bus);
|
||||
});
|
|
@ -4,6 +4,9 @@ import { useI18n } from 'vue-i18n';
|
|||
import { useRequired } from 'src/composables/useRequired';
|
||||
|
||||
const $attrs = useAttrs();
|
||||
import { inject } from 'vue';
|
||||
|
||||
const bus = inject('bus'); // inside setup()
|
||||
const { isRequired, requiredFieldRule } = useRequired($attrs);
|
||||
const { t } = useI18n();
|
||||
const emit = defineEmits([
|
||||
|
@ -107,6 +110,8 @@ const mixinRules = [
|
|||
value = null;
|
||||
vnInputRef.focus();
|
||||
emit('remove');
|
||||
console.log('HOLA');
|
||||
bus.emit('some-event', 'hola');
|
||||
}
|
||||
"
|
||||
></QIcon>
|
||||
|
|
|
@ -5,7 +5,13 @@ import { useArrayData } from 'composables/useArrayData';
|
|||
import { useRoute } from 'vue-router';
|
||||
import toDate from 'filters/toDate';
|
||||
import VnFilterPanelChip from 'components/ui/VnFilterPanelChip.vue';
|
||||
import { inject } from 'vue';
|
||||
|
||||
const bus = inject('bus'); // inside setup()
|
||||
console.log('bus: ', bus);
|
||||
bus.on('some-event', (arg1, arg2, arg3) => {
|
||||
console.log('REMOVED');
|
||||
});
|
||||
const { t } = useI18n();
|
||||
const $props = defineProps({
|
||||
modelValue: {
|
||||
|
@ -294,7 +300,12 @@ defineExpose({ search, sanitizer, userParams });
|
|||
<QSeparator />
|
||||
</QList>
|
||||
<QList dense class="list q-gutter-y-sm q-mt-sm">
|
||||
<slot name="body" :params="sanitizer(userParams)" :search-fn="search"></slot>
|
||||
<slot
|
||||
name="body"
|
||||
:params="sanitizer(userParams)"
|
||||
:search-fn="search"
|
||||
@remove="(key) => console.log('ASD')"
|
||||
></slot>
|
||||
</QList>
|
||||
</QForm>
|
||||
<QInnerLoading
|
||||
|
|
Loading…
Reference in New Issue