Document all vue events with the emits option.

This commit is contained in:
timongh 2023-02-05 02:18:43 +08:00
parent 0cc80b29ef
commit c07abaaa05
28 changed files with 28 additions and 0 deletions

View File

@ -38,6 +38,7 @@ export default defineComponent({
required: true,
},
},
emits: ['change'],
data() {
return {
folders: [] as FavoritesFolder[],

View File

@ -23,6 +23,7 @@ import { VButton, VIcon } from '@/ui'
export default defineComponent({
components: { VButton, VIcon },
emits: ['refresh'],
data() {
return {
size: 28,

View File

@ -78,6 +78,7 @@ export default defineComponent({
required: true,
},
},
emits: ['set-default-location'],
data() {
return {
curPosition: getScrollY(),

View File

@ -53,6 +53,7 @@ export default defineComponent({
default: true,
},
},
emits: ['change'],
data() {
return {
realHidden: this.hidden,

View File

@ -38,6 +38,7 @@ export default defineComponent({
required: true,
},
},
emits: ['change'],
data() {
return {
items: Object.values(itemsMap),

View File

@ -36,6 +36,7 @@ export default defineComponent({
required: true,
},
},
emits: ['discard'],
methods: {
discard() {
this.$emit('discard')

View File

@ -55,6 +55,7 @@ export default defineComponent({
required: true,
},
},
emits: ['action', 'delete-item', 'previous-item', 'next-item'],
methods: {
performAction(event: KeyboardEvent | MouseEvent) {
this.action.action()

View File

@ -136,6 +136,7 @@ const ThisComponent = defineComponent({
VEmpty,
ActionItem,
},
emits: ['close'],
data() {
return {
recommended,

View File

@ -33,6 +33,7 @@ export default defineComponent({
default: '',
},
},
emits: ['dialog-close'],
data() {
return {
detailsLink,

View File

@ -111,6 +111,7 @@ export default defineComponent({
MiniToast,
},
mixins: [componentSettingsMixin],
emits: ['close', 'mounted'],
data() {
return {
virtual: false,

View File

@ -70,6 +70,7 @@ import { tagFilters } from './tag-filter'
export default defineComponent({
components: { VIcon, VPopup },
emits: ['change'],
data() {
return {
tags: [],

View File

@ -100,6 +100,7 @@ export default defineComponent({
ComponentDetail,
ComponentTags,
},
emits: ['close'],
data() {
return {
components,

View File

@ -115,6 +115,7 @@ export default defineComponent({
default: ItemFilter.All,
},
},
emits: ['refresh'],
data() {
const { icon, badge, getUrl, isInstalled } = typeMappings[this.item.type]
return {

View File

@ -48,6 +48,7 @@ export default defineComponent({
default: () => ({}),
},
},
emits: ['close'],
data() {
return {
open: false,

View File

@ -35,6 +35,7 @@ export default defineComponent({
default: undefined,
},
},
emits: ['change'],
data() {
return {
toast: null,

View File

@ -49,6 +49,7 @@ export default defineComponent({
default: 'mdi-checkbox-blank-circle-outline',
},
},
emits: ['change'],
})
</script>

View File

@ -250,6 +250,7 @@ export default defineComponent({
default: 0,
},
},
emits: ['change'],
data() {
return {
popupOpened: false,

View File

@ -122,6 +122,7 @@ export default defineComponent({
required: true,
},
},
emits: ['change'],
data() {
return {
images,

View File

@ -34,6 +34,7 @@ export default defineComponent({
default: () => (item: any) => item,
},
},
emits: ['next-page', 'prev-page'],
data() {
return {
items: [...this.initialItems],

View File

@ -61,6 +61,7 @@ export default defineComponent({
default: 'mdi-radiobox-blank',
},
},
emits: ['change'],
watch: {
checked(newValue: boolean) {
if (newValue) {

View File

@ -73,6 +73,7 @@ export default defineComponent({
default: undefined,
},
},
emits: ['change'],
data() {
return {
wrapper: createWrapper(this),

View File

@ -13,6 +13,7 @@ export default defineComponent({
components: {
VLoading: () => import('./VLoading.vue').then(m => m.default),
},
emits: ['trigger'],
async mounted() {
const console = useScopedConsole('ScrollTrigger')
const element = this.$el as HTMLElement

View File

@ -43,6 +43,7 @@ export default defineComponent({
default: false,
},
},
emits: ['change'],
methods: {
toggle() {
if (this.disabled) {

View File

@ -85,6 +85,7 @@ export default defineComponent({
default: null,
},
},
emits: ['change'],
data() {
return {
selectedTab: (this.tabs.find((t: TabMapping) => t.name === this.defaultTab) ??

View File

@ -96,6 +96,7 @@ export default defineComponent({
default: false,
},
},
emits: ['change'],
data() {
return {
popupOpen: false,

View File

@ -70,6 +70,7 @@ export default defineComponent({
default: null,
},
},
emits: ['popup-change'],
data() {
return {
loaded: !this.lazy,

View File

@ -126,6 +126,7 @@ export default defineComponent({
default: (v: number) => String(v),
},
},
emits: ['change', 'start', 'end'],
data() {
return {
//

View File

@ -22,6 +22,7 @@ export const textControlMixin = defineComponent({
default: undefined,
},
},
emits: ['change'],
data() {
return {
composing: false,