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

Commit 1ea4906

Browse files
committed
Some fixes
1 parent 8a9acb2 commit 1ea4906

File tree

4 files changed

+44
-6
lines changed

4 files changed

+44
-6
lines changed

.editorconfig

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# EditorConfig is awesome: http://EditorConfig.org
2+
3+
root = true
4+
5+
[*]
6+
end_of_line = lf
7+
charset = utf-8
8+
insert_final_newline = true
9+
max_line_length = 80
10+
trim_trailing_whitespace = true
11+
indent_style = space
12+
indent_size = 2

src/components/index.ts

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import twCompletion from "./tw-completion.vue"
99
import twTagInput from "./tw-tag-input.vue"
1010
import twInput from "./tw-input.vue"
1111
import twNotification from "./tw-notification.vue"
12+
import { notification } from "./notification"
1213

1314
export {
1415
twButton,
@@ -21,4 +22,6 @@ export {
2122
twCompletion,
2223
twTagInput,
2324
twInput,
25+
twNotification,
26+
notification,
2427
}

src/components/tw-notification.vue

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
<template>
22
<teleport to="body">
3-
<div class="notification-container">
3+
<div class="tw-notification-container">
44
<transition-group name="notification" tag="div">
5-
<div class="notification" v-for="n in notifications" :key="n.id">
6-
<div class="notification-title">{{ n.title }}</div>
7-
<div class="notification-message">{{ n.message }}</div>
5+
<div class="tw-notification" v-for="n in notifications" :key="n.id">
6+
<div class="tw-notification-title">{{ n.title }}</div>
7+
<div class="tw-notification-message">{{ n.message }}</div>
88
</div>
99
</transition-group>
1010
</div>
1111
</teleport>
1212
</template>
1313

1414
<script lang="ts">
15-
import { defineComponent, ref, computed, PropType } from "vue"
16-
import { notifications, TwindyNotification } from "./notification"
15+
import { defineComponent } from "vue"
16+
import { notifications } from "./notification"
1717
1818
export default defineComponent({
1919
setup(props) {

src/components/usetextarea.ts

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { useEventListener, useResizeObserver } from "@vueuse/core"
2+
import { onMounted, onUpdated } from "vue"
3+
4+
export function useTextareaResize(r) {
5+
const resize = () => {
6+
let el = r.value
7+
el.style.height = "1px"
8+
el.style.height = el.scrollHeight + 2 + "px"
9+
}
10+
11+
onUpdated(() => {
12+
console.log("ttt", r)
13+
r.value.setAttribute(
14+
"style",
15+
"height:" +
16+
(r.value.scrollHeight + 2) +
17+
"px;overflow-y:hidden;resize:none;"
18+
)
19+
})
20+
21+
// useEventListener(r, "input", resize)
22+
// useResizeObserver(r, resize)
23+
}

0 commit comments

Comments
 (0)