mirror of
https://github.com/lana-k/sqliteviz.git
synced 2025-12-06 18:18:53 +08:00
Fix: Search table error #29
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "sqliteviz",
|
"name": "sqliteviz",
|
||||||
"version": "0.7.0",
|
"version": "0.8.0",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -5,20 +5,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div id="db">
|
<div id="db">
|
||||||
<div @click="schemaVisible = !schemaVisible" class="db-name">
|
<div @click="schemaVisible = !schemaVisible" class="db-name">
|
||||||
<svg
|
<tree-chevron :expanded="schemaVisible"/>
|
||||||
:style="{ transform: schemaVisible ? 'rotate(90deg)' : 'rotate(0)' }"
|
|
||||||
class="chevron-icon"
|
|
||||||
width="9"
|
|
||||||
height="9"
|
|
||||||
viewBox="0 0 8 12"
|
|
||||||
fill="none"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
>
|
|
||||||
<path
|
|
||||||
d="M0.721924 9.93097L4.85292 5.79997L0.721924 1.66897L1.99992 0.399973L7.39992 5.79997L1.99992 11.2L0.721924 9.93097Z"
|
|
||||||
:fill="schemaVisible ? '#506784' : 'rgba(80, 103, 132, 0.5)'"
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
{{ dbName }}
|
{{ dbName }}
|
||||||
</div>
|
</div>
|
||||||
<div class="db-edit">
|
<div class="db-edit">
|
||||||
@@ -43,13 +30,15 @@
|
|||||||
import TableDescription from '@/components/TableDescription'
|
import TableDescription from '@/components/TableDescription'
|
||||||
import TextField from '@/components/TextField'
|
import TextField from '@/components/TextField'
|
||||||
import ChangeDbIcon from '@/components/svg/changeDb'
|
import ChangeDbIcon from '@/components/svg/changeDb'
|
||||||
|
import TreeChevron from '@/components/svg/treeChevron'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Schema',
|
name: 'Schema',
|
||||||
components: {
|
components: {
|
||||||
TableDescription,
|
TableDescription,
|
||||||
TextField,
|
TextField,
|
||||||
ChangeDbIcon
|
ChangeDbIcon,
|
||||||
|
TreeChevron
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
@@ -66,7 +55,7 @@ export default {
|
|||||||
return !this.filter
|
return !this.filter
|
||||||
? this.$store.state.schema
|
? this.$store.state.schema
|
||||||
: this.$store.state.schema.filter(
|
: this.$store.state.schema.filter(
|
||||||
table => table[0].toUpperCase().indexOf(this.filter.toUpperCase()) !== -1
|
table => table.name.toUpperCase().indexOf(this.filter.toUpperCase()) !== -1
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
dbName () {
|
dbName () {
|
||||||
@@ -120,12 +109,9 @@ export default {
|
|||||||
.db-name {
|
.db-name {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
>>> .chevron-icon {
|
|
||||||
-webkit-transition: transform .15s ease-in-out;
|
|
||||||
transition: transform .15s ease-in-out;
|
|
||||||
}
|
|
||||||
.db-name:hover .chevron-icon path,
|
.db-name:hover .chevron-icon path,
|
||||||
>>> .table-name:hover .chevron-icon path {
|
>>> .table-name:hover .chevron-icon path {
|
||||||
fill: #506784;
|
fill: var(--color-gray-dark);
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,20 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div @click="colVisible = !colVisible" class="table-name">
|
<div @click="colVisible = !colVisible" class="table-name">
|
||||||
<svg
|
<tree-chevron :expanded="colVisible"/>
|
||||||
:style="{transform: colVisible ? 'rotate(90deg)' : 'rotate(0)'}"
|
|
||||||
class="chevron-icon"
|
|
||||||
width="9"
|
|
||||||
height="9"
|
|
||||||
viewBox="0 0 8 12"
|
|
||||||
fill="none"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
>
|
|
||||||
<path
|
|
||||||
d="M0.721924 9.93097L4.85292 5.79997L0.721924 1.66897L1.99992 0.399973L7.39992 5.79997L1.99992 11.2L0.721924 9.93097Z"
|
|
||||||
:fill="colVisible ? '#506784' : 'rgba(80, 103, 132, 0.5)'"
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
{{ name }}
|
{{ name }}
|
||||||
</div>
|
</div>
|
||||||
<div v-show="colVisible" class="columns">
|
<div v-show="colVisible" class="columns">
|
||||||
@@ -27,9 +14,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import TreeChevron from '@/components/svg/treeChevron'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'TableDescription',
|
name: 'TableDescription',
|
||||||
|
components: { TreeChevron },
|
||||||
props: ['name', 'columns'],
|
props: ['name', 'columns'],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
|||||||
36
src/components/svg/treeChevron.vue
Normal file
36
src/components/svg/treeChevron.vue
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
<template>
|
||||||
|
<svg
|
||||||
|
:style="{ transform: expanded ? 'rotate(90deg)' : 'rotate(0)' }"
|
||||||
|
class="chevron-icon"
|
||||||
|
width="9"
|
||||||
|
height="9"
|
||||||
|
viewBox="0 0 8 12"
|
||||||
|
fill="none"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M0.721924 9.93097L4.85292 5.79997L0.721924 1.66897L1.99992 0.399973L7.39992 5.79997L1.99992 11.2L0.721924 9.93097Z"
|
||||||
|
:fill="expanded ? '#506784' : 'rgba(80, 103, 132, 0.5)'"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'treeChevron',
|
||||||
|
props: {
|
||||||
|
expanded: {
|
||||||
|
type: Boolean,
|
||||||
|
required: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.chevron-icon {
|
||||||
|
-webkit-transition: transform .15s ease-in-out;
|
||||||
|
transition: transform .15s ease-in-out;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user