Skip to content

Commit

Permalink
fix(Vue-vite): remove @types/react from vite
Browse files Browse the repository at this point in the history
  • Loading branch information
sabertazimi committed Oct 4, 2021
1 parent 9ab2e83 commit 884b760
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
19 changes: 11 additions & 8 deletions packages/vue-trello/src/composables/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { AppStore } from 'src/store';

const moveTask = (
store: AppStore,
event: React.DragEvent,
event: DragEvent,
toColumnIndex: number,
toTaskIndex?: number
) => {
Expand All @@ -22,7 +22,7 @@ const moveTask = (

const moveColumn = (
store: AppStore,
event: React.DragEvent,
event: DragEvent,
toColumnIndex: number
) => {
const dataTransfer = event.dataTransfer;
Expand All @@ -35,17 +35,20 @@ const moveColumn = (

const move = (
store: AppStore,
event: React.DragEvent,
event: DragEvent,
toColumnIndex: number,
toTaskIndex?: number
) => {
const dataTransfer = event.dataTransfer;
const type = dataTransfer.getData('type');

if (type === 'column') {
moveColumn(store, event, toColumnIndex);
} else {
moveTask(store, event, toColumnIndex, toTaskIndex);
if (dataTransfer) {
const type = dataTransfer.getData('type');

if (type === 'column') {
moveColumn(store, event, toColumnIndex);
} else {
moveTask(store, event, toColumnIndex, toTaskIndex);
}
}
};

Expand Down
2 changes: 1 addition & 1 deletion packages/vue-trello/src/views/Task.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const task = computed(() => store.getters.getTask(props.id));
const close = () => router.push({ name: 'board' });
const updateTask = (event: React.FormEvent, task: TaskType, key: string) => {
const updateTask = (event: Event, task: TaskType, key: string) => {
store.commit('updateTask', {
task,
key,
Expand Down
3 changes: 2 additions & 1 deletion packages/vue-trello/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"esModuleInterop": true,
"skipLibCheck": true,
"baseUrl": ".",
"lib": ["esnext", "dom"]
"lib": ["esnext", "dom"],
"types": ["vite/client"]
},
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"]
}

0 comments on commit 884b760

Please sign in to comment.