return h('div', { class: 'js-line log-line' }, [
h(LineNumber, {
props: {
lineNumber: line.lineNumber,
path,
},
}),
...chars,
]
import { formatDate, getTimeago } from '../../lib/utils/datetime_utility';
export default {
methods: {
timeFormatted(time) {
const timeago = getTimeago();
return timeago.format(time);
},
tooltipTitle(time) {
return formatDate(time);
},
},
};
import { formatDate, getTimeago } from '../../lib/utils/datetime_utility';
export default function useTimeAgo() {
const timeFormatted = (time) => getTimeago.format(time)
const tooltipTitle = (time) => formatDate(time)
return { timeFormatted, tooltipTitle }
}
apollo: {
permissions: {
query: permissionsQuery,
variables() {
return {
fullPath: this.projectPath,
iid: this.issueIid,
};
},
update: data => data.project.issue.userPermissions,
},
},
import { useQuery, useResult } from '@vue/apollo-composable'
const { result, loading } = useQuery(permissionsQuery,
{
fullPath: this.projectPath,
iid: this.issueIid,
})
const permissions = useResult(result, null, data => data.project.issue.userPermissions)
<apollo-mutation
#default="{ mutate, loading, error }"
:mutation="$options.destroyDesignMutation"
:variables="{
filenames,
projectPath,
iid,
}"
:update="updateStoreAfterDelete"
v-on="$listeners"
>
<slot v-bind="{ mutate, loading, error }"></slot>
</apollo-mutation>
import { useMutation } from '@vue/apollo-composable'
const { mutate: deleteDesign } = useMutation(
destroyDesignMutation,
{
variables: {
filenames: this.filenames,
projectPath: this.projectPath,
iid: this.iid,
},
update: this.updateStoreAfterDelete
}
)
<gl-table
class="alert-management-table"
:items="alerts ? alerts.list : []"
:fields="$options.fields"
:sort-direction="sortDirection"
:sort-desc.sync="sortDesc"
:sort-by.sync="sortBy"
sort-icon-left
fixed
@row-clicked="navigateToAlertDetails"
@sort-changed="fetchSortedData"
>
<gl-table
class="alert-management-table"
:items="alerts ? alerts.list : []"
:fields="$options.fields"
:sort-direction="sortDirection"
v-model:sort-desc="sortDesc"
v-model:sort-by="sortBy"
sort-icon-left
fixed
@row-clicked="navigateToAlertDetails"
@sort-changed="fetchSortedData"
>
model: {
prop: 'entities',
},
v-model:entities="smth"
import { defineComponent } from 'vue'
const Component = defineComponent({
// type inference enabled
})
const Component = defineComponent({
data() {
return {
count: 0
}
},
mounted() {
const result = this.count.split('')
// => Property 'split' does not exist on type 'number'
}
})