@ramathibodi/nuxt-commons 0.0.9 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/dist/module.json +1 -1
- package/dist/runtime/components/SplitterPanel.vue +12 -22
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -67,6 +67,12 @@ npm run test:watch
|
|
|
67
67
|
npm run release
|
|
68
68
|
```
|
|
69
69
|
|
|
70
|
+
## NPM Login
|
|
71
|
+
```bash
|
|
72
|
+
npm login
|
|
73
|
+
```
|
|
74
|
+
- จะส่ง link url มาให้เข้าไปที่ url login npm
|
|
75
|
+
|
|
70
76
|
## NPM PUBLISH
|
|
71
77
|
```bash
|
|
72
78
|
1. ตรวจสอบ source code, ตรวจสอบ Branch ว่าเป็น master แล้ว จากนั้นตรวจสอบ version ของ npm ว่ามีการเปลี่ยนและไม่ชนกับ version บน npm
|
package/dist/module.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { ref
|
|
2
|
+
import { ref } from 'vue';
|
|
3
3
|
import { VCard } from 'vuetify/components/VCard'
|
|
4
4
|
const isResizing = ref(false);
|
|
5
5
|
const pane1Width = ref('50%');
|
|
6
|
+
const containerRef = ref<HTMLElement>()
|
|
6
7
|
interface Props extends /* @vue-ignore */ InstanceType<typeof VCard['$props']>{
|
|
7
|
-
height : number | string
|
|
8
|
+
height? : number | string
|
|
8
9
|
}
|
|
9
10
|
const props = defineProps<Props>()
|
|
10
11
|
|
|
@@ -17,36 +18,25 @@ const stopResize = () => {
|
|
|
17
18
|
};
|
|
18
19
|
|
|
19
20
|
const resize = (event: MouseEvent) => {
|
|
20
|
-
if (isResizing.value) {
|
|
21
|
-
const
|
|
22
|
-
const containerRect = container.getBoundingClientRect();
|
|
21
|
+
if (isResizing.value && containerRef.value) {
|
|
22
|
+
const containerRect = containerRef.value.getBoundingClientRect();
|
|
23
23
|
const newWidth = event.clientX - containerRect.left;
|
|
24
24
|
pane1Width.value = `${(newWidth / containerRect.width) * 100}%`;
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
|
-
|
|
28
|
-
onMounted(() => {
|
|
29
|
-
document.addEventListener('mousemove', resize);
|
|
30
|
-
document.addEventListener('mouseup', stopResize);
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
onUnmounted(() => {
|
|
34
|
-
document.removeEventListener('mousemove', resize);
|
|
35
|
-
document.removeEventListener('mouseup', stopResize);
|
|
36
|
-
});
|
|
37
27
|
</script>
|
|
38
28
|
|
|
39
29
|
<template>
|
|
40
30
|
<v-card :="$attrs">
|
|
41
31
|
<v-sheet border :height="height">
|
|
42
|
-
<div class="
|
|
43
|
-
<
|
|
32
|
+
<div class="d-flex" ref="containerRef" @mouseup="stopResize" @mousemove="resize" >
|
|
33
|
+
<v-sheet :width = "pane1Width">
|
|
44
34
|
<slot name="left"></slot>
|
|
45
|
-
</
|
|
46
|
-
<v-divider :thickness="3" vertical class="cursor-move" @mousedown="startResize"></v-divider>
|
|
47
|
-
<
|
|
35
|
+
</v-sheet>
|
|
36
|
+
<v-divider :thickness="3" vertical class="cursor-move" @mousedown="startResize" ></v-divider>
|
|
37
|
+
<v-sheet :width = "`calc(100% - ${pane1Width})`" >
|
|
48
38
|
<slot name="right"></slot>
|
|
49
|
-
</
|
|
39
|
+
</v-sheet>
|
|
50
40
|
</div>
|
|
51
41
|
</v-sheet>
|
|
52
42
|
|
|
@@ -55,5 +45,5 @@ onUnmounted(() => {
|
|
|
55
45
|
</template>
|
|
56
46
|
|
|
57
47
|
<style scoped>
|
|
58
|
-
|
|
48
|
+
|
|
59
49
|
</style>
|