Skip to content
This repository was archived by the owner on Sep 3, 2024. It is now read-only.

Commit e2e3792

Browse files
committed
Fix CSS import
1 parent 1b565b7 commit e2e3792

File tree

3 files changed

+24
-8
lines changed

3 files changed

+24
-8
lines changed

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@ If placed somewhere in the project will show tooltips for elements having a `too
6464

6565
See also: `tw-popover`
6666

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+
6775
---
6876

6977
### useActive(props)

package.json

+7-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
".": {
1414
"require": "./dist/index.cjs",
1515
"default": "./dist/index.js"
16+
},
17+
"./index.css": {
18+
"default": "./dist/style.css"
19+
},
20+
"./style.css": {
21+
"default": "./dist/style.css"
1622
}
1723
},
1824
"dependencies": {
@@ -45,4 +51,4 @@
4551
"format": "prettier --write .",
4652
"prepublishOnly": "npm run build"
4753
}
48-
}
54+
}

src/menu.ts

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
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"
33
import { TwindyMenuItem } from "./types"
44

5-
// let container = document.createElement("div")
6-
// document.body.appendChild(container)
7-
// createApp(twMenu).mount(container)
5+
let container: HTMLElement | undefined
86

97
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+
1214
return {
1315
toggleMenu() {
1416
// console.log("toggle menu")

0 commit comments

Comments
 (0)