This repository was archived by the owner on Sep 3, 2024. It is now read-only.
File tree 3 files changed +24
-8
lines changed
3 files changed +24
-8
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,14 @@ If placed somewhere in the project will show tooltips for elements having a `too
64
64
65
65
See also: ` tw-popover `
66
66
67
+ ### tw-debug
68
+
69
+ Debug output of Vue reactive objects. Requires CSS import:
70
+
71
+ ``` js
72
+ import " twindy-headless/index.css"
73
+ ```
74
+
67
75
---
68
76
69
77
### useActive(props)
Original file line number Diff line number Diff line change 13
13
"." : {
14
14
"require" : " ./dist/index.cjs" ,
15
15
"default" : " ./dist/index.js"
16
+ },
17
+ "./index.css" : {
18
+ "default" : " ./dist/style.css"
19
+ },
20
+ "./style.css" : {
21
+ "default" : " ./dist/style.css"
16
22
}
17
23
},
18
24
"dependencies" : {
45
51
"format" : " prettier --write ." ,
46
52
"prepublishOnly" : " npm run build"
47
53
}
48
- }
54
+ }
Original file line number Diff line number Diff line change 1
- import { Ref } from "vue"
2
- // import twMenu from "./tw-menu.vue"
1
+ import { createApp , Ref } from "vue"
2
+ import twMenu from "./tw-menu.vue"
3
3
import { TwindyMenuItem } from "./types"
4
4
5
- // let container = document.createElement("div")
6
- // document.body.appendChild(container)
7
- // createApp(twMenu).mount(container)
5
+ let container : HTMLElement | undefined
8
6
9
7
export function useMenu ( items : TwindyMenuItem [ ] , ref ?: Ref ) {
10
- items
11
- ref
8
+ if ( container == null ) {
9
+ let container = document . createElement ( "div" )
10
+ document . body . appendChild ( container )
11
+ createApp ( twMenu ) . mount ( container )
12
+ }
13
+
12
14
return {
13
15
toggleMenu ( ) {
14
16
// console.log("toggle menu")
You can’t perform that action at this time.
0 commit comments