Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
lizyChy0329 committed Oct 25, 2024
1 parent dc2131d commit 47230bb
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 40 deletions.
29 changes: 17 additions & 12 deletions views/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<script setup lang="ts">
import type { ImagesData } from './types'
import { computed, ref } from 'vue'
import List from './components/List.vue'
import SearchBar from './SearchBar.vue'
import SearchBar from './components/SearchBar.vue'
import { imageSize, isLandscape } from './state'
// const { window, workspace } = acquireVsCodeApi()
Expand All @@ -15,22 +17,25 @@ window.addEventListener('message', (e) => {
if (receiveData.type === 'initImages' || receiveData.type === 'updateImages') {
vscodePostData.value = receiveData.data
console.log('🚀 ~ window.addEventListener ~ receiveData.data:', receiveData.data)
}
})
const imageSize = ref<PineConeImageSize>('medium')
</script>

<template>
<div v-if="vscodePostData" space-y-4>
<SearchBar v-model:search="search" v-model:image-size="imageSize" />

<!-- Breadcrumbs -->
<div border-b-2 border-amber border-solid pb-2 class="text-base sm:text-lg">
{{ vscodePostData.currentAssetsPath }} ({{ vscodePostData.imagesData.length }})
<div
v-if="vscodePostData"
flex="~" space-y-4 :class="{
'flex-row': isLandscape,
'flex-col': !isLandscape,
}"
>
<SearchBar />

<div w-full space-y-2>
<div border-b-2 border-amber border-solid pb-2 class="text-base sm:text-lg">
{{ vscodePostData.currentAssetsPath }} ({{ vscodePostData.imagesData.length }})
</div>
<List :data="imagesDataFilter" :size="imageSize" />
</div>

<List :data="imagesDataFilter" :size="imageSize" />
</div>
</template>
15 changes: 0 additions & 15 deletions views/src/components/List.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,11 @@ import type { PineConeImageSize } from '../types'
import { computed, defineProps } from 'vue'
import { imageListMock } from '../schema.ts'

// const props = withDefaults(defineProps<{
// data: ImageListData
// size: PineConeImageSize
// }>(), {
// data: imageListMock,
// size: 'medium',
// })
// const props = withDefaults(, {
// data: () => imageListMock,
// size: 'medium',
// })

const { data = imageListMock, size = 'medium' } = defineProps<{
data?: ImageListData
size?: PineConeImageSize
}>()

// basename: '1.png',
// extname: '.png'

const gridRepeatMode = computed(() => {
switch (size) {
case 'small':
Expand Down
2 changes: 1 addition & 1 deletion views/src/components/SearchBarLandscape.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
const searchVModel = defineModel('search')
// const searchVModel = defineModel('search')
const imageSizeVModel = defineModel('imageSize')
</script>

Expand Down
8 changes: 4 additions & 4 deletions views/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { createApp } from 'vue'
// import App from './App.vue'
import HelloWorld from './components/HelloWorld.vue'
import App from './App.vue'
// import HelloWorld from './components/HelloWorld.vue'
// import './style.css'
import '@unocss/reset/tailwind-compat.css'
import 'virtual:uno.css'

// createApp(App).mount('#app')
createApp(HelloWorld).mount('#app')
createApp(App).mount('#app')
// createApp(HelloWorld).mount('#app')
2 changes: 1 addition & 1 deletion views/src/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
declare type ImagesData = {
export type ImagesData = {
imageFileUri: string
imageVsCodePath: string
basename: string
Expand Down
2 changes: 1 addition & 1 deletion views/target/assets/index.css

Large diffs are not rendered by default.

20 changes: 15 additions & 5 deletions views/target/assets/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion views/tsconfig.app.tsbuildinfo
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"root":["./src/main.ts","./src/types.d.ts","./src/vite-env.d.ts","./src/app.vue","./src/components/helloworld.vue","./src/components/list.vue"],"version":"5.6.3"}
{"root":["./src/main.ts","./src/schema.ts","./src/state.ts","./src/types.d.ts","./src/vite-env.d.ts","./src/app.vue","./src/components/helloworld.vue","./src/components/list.vue","./src/components/searchbar.vue","./src/components/searchbarlandscape.vue","./src/components/searchbarportrait.vue"],"version":"5.6.3"}

0 comments on commit 47230bb

Please sign in to comment.