Skip to content

Commit d3aa5e8

Browse files
updated README.md
1 parent 1257db5 commit d3aa5e8

File tree

7 files changed

+57
-17
lines changed

7 files changed

+57
-17
lines changed

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,21 @@ https://user-images.githubusercontent.com/150185/213549880-e6b645bd-11f0-461a-b1
77
https://user-images.githubusercontent.com/150185/213549905-360698e2-0c6b-4fd1-8023-803e22b68e27.mov
88

99
Video example code:
10+
11+
```html
12+
<script setup>
13+
```
1014
```js
1115
import { getCurrentInstance } from 'vue'
1216
const instance = getCurrentInstance()
1317
```
1418
```html
15-
<vue-dd name="setupState" v-model="instance.setupState" max-height="300px" />
19+
</script>
20+
```
21+
```html
22+
<template>
23+
<vue-dd name="setupState" v-model="instance.setupState" max-height="300px" />
24+
</template>
1625
```
1726

1827
## About

vue-dd/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ https://user-images.githubusercontent.com/150185/213549905-360698e2-0c6b-4fd1-80
88

99
Video example code:
1010
```js
11+
import VueDd from 'vue-dd'
1112
import { getCurrentInstance } from 'vue'
1213
const instance = getCurrentInstance()
1314
```
@@ -31,7 +32,9 @@ yarn add vue-dd
3132
Add globally in main.js
3233
```js
3334
import VueDd from 'vue-dd'
35+
// create app
3436
const app = createApp(App)
37+
// register component
3538
app.component('VueDd', VueDd)
3639
```
3740
or add locally

vue-dd/src/NodeComplex.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -708,10 +708,8 @@ export default {
708708
open: {
709709
handler (value, oldValue) {
710710
711-
712711
if (!value) {
713712
714-
715713
const hideEverything = () => {
716714
this.useOpenLevel = 0
717715
this.useOpenSpecific = []

vue-dd/src/NodePrimitive.vue

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<span
77
v-if="showName"
88
:class="{
9-
'vue-dd-key' : true,
10-
'vue-dd-key-of-array' : parentIsArray,
9+
'vue-dd-key': true,
10+
'vue-dd-key-of-array': parentIsArray,
1111
}">{{ name }}<span class="vue-dd-colon">:</span></span><span
1212
v-if="parentOpen && saveFocus"
1313
ref="focusElement"
@@ -17,8 +17,8 @@
1717
@mouseup="hover=false"
1818
@mouseleave="hover=false"
1919
:class="{
20-
'vue-dd-focus-hover':hover,
21-
'vue-dd-focus-selected':isFocused
20+
'vue-dd-focus-hover': hover,
21+
'vue-dd-focus-selected': isFocused
2222
}"
2323
></span>
2424
<span v-if="type === 'null'"
@@ -27,6 +27,8 @@
2727
class="vue-dd-undefined">undefined</span>
2828
<span v-else-if="type === 'number'"
2929
class="vue-dd-number">{{ modelValue }}</span>
30+
<span v-else-if="type === 'bigint'"
31+
class="vue-dd-bigint">{{ modelValue }}</span>
3032
<span v-else-if="type === 'string'"
3133
class="vue-dd-string">"{{ escapeQuotesFn(modelValue) }}"</span>
3234
<span v-else-if="type === 'boolean'"
@@ -35,7 +37,7 @@
3537
<span v-else-if="type === 'symbol'"
3638
class="vue-dd-symbol">{{ modelValue.toString() }}</span>
3739
<span v-else
38-
class="vue-dd-false">[unknown_type]{{ modelValue }}</span>
40+
class="vue-dd-unknown">[unknown_type]{{ modelValue }}</span>
3941
<span class="vue-dd-comma" v-if="shouldComma">,</span>
4042
</span>
4143
</template>

vue-dd/src/css/VueDd.css

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,6 @@ button.vue-dd-expand:active {
260260
color: #55606a;
261261
}
262262

263-
264263
.vue-dd-dark pre.vue-dd-f-start {
265264
padding: 0;
266265
margin: 0;
@@ -337,6 +336,11 @@ button.vue-dd-arrow-collapsed {
337336
color: #21BA45;
338337
-webkit-user-select: none;
339338
}
339+
340+
.vue-dd-dark .vue-dd-instance {
341+
342+
}
343+
340344
.vue-dd-instance + .vue-dd-size {
341345
margin-left: 2px;
342346
}
@@ -408,8 +412,27 @@ button.vue-dd-arrow-collapsed {
408412
color: #4067b2;
409413
}
410414

415+
.vue-dd-bigint {
416+
color: #5a38be;
417+
}
418+
419+
.vue-dd-dark .vue-dd-bigint {
420+
color: #7046e8;
421+
}
422+
411423
.vue-dd-false {
412-
cursor: default;
424+
color: #f34747;
425+
}
426+
427+
.vue-dd-dark .vue-dd-false {
428+
color: #f34747;
429+
}
430+
431+
.vue-dd-unknown {
432+
color: #f34747;
433+
}
434+
435+
.vue-dd-dark .vue-dd-unknown {
413436
color: #f34747;
414437
}
415438

@@ -518,23 +541,28 @@ button.vue-dd-arrow-collapsed {
518541
}
519542

520543
.vue-dd-comma {
544+
color: #999;
521545
padding-right: 3px;
522546
}
523547

548+
.vue-dd-dark .vue-dd-comma {
549+
color: #333;
550+
}
551+
524552
.vue-dd-obj-char {
525-
color: #2c3e50;
553+
color: #7490ab;
526554
padding: 0 1px;
527555
}
528556

529-
.vue-dd-dark.vue-dd-obj-char {
557+
.vue-dd-dark .vue-dd-obj-char {
530558
color: #555;
531559
}
532560

533561
.vue-dd-arr-char {
534-
color: #2c3e50;
562+
color: #7490ab;
535563
padding: 0 1px;
536564
}
537565

538-
.vue-dd-dark.vue-dd-arr-char {
566+
.vue-dd-dark .vue-dd-arr-char {
539567
color: #555;
540568
}

vue3/src/components/VueDdTest.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const set = reactive(new Set())
6666
Window object displayed:
6767
<br />
6868
dark: <base-checkbox v-model="dark" /><br />
69-
<vue-dd name="setupState" :dark="dark" v-model="instance.setupState" max-height="300px" :deep="true" />
69+
<vue-dd name="setupState" :dark="dark" v-model="instance.setupState" max-height="300px" :deep="false" />
7070
<!-- <vue-dd name="test" delimiter="$" :dark="dark" v-model="bool" />-->
7171
<!-- <vue-dd name="ref" :dark="dark" v-model="text" />-->
7272
<!-- <vue-dd name="refObject" :dark="dark" v-model="refObject" />-->

vue3/src/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { createApp } from 'vue'
22
import { createPinia } from 'pinia'
3-
import VueDd from 'vue-dd'
3+
// import VueDd from 'vue-dd'
44

5-
// import VueDd from '../../vue-dd/src/VueDd.vue'
5+
import VueDd from '../../vue-dd/src/VueDd.vue'
66

77
import App from './App.vue'
88
import router from './router'

0 commit comments

Comments
 (0)