Skip to content

Commit fe08264

Browse files
authored
Merge pull request #48 from InhiblabCore/dev
docs: inline style
2 parents e0ac284 + 802bfaa commit fe08264

File tree

75 files changed

+454
-668
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+454
-668
lines changed

packages/hooks/src/useAsyncOrder/demo/demo.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,3 @@
7171
},
7272
})
7373
</script>
74-
75-
<style scoped lang="less"></style>

packages/hooks/src/useBoolean/demo/demo.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
<br>
55
<div>
66
<p>
7-
<vhp-button style="margin-left: 16px" @click="() => set(!flag)">set</vhp-button>
8-
<vhp-button style="margin-left: 16px" @click="() => setTrue()">setTrue</vhp-button>
9-
<vhp-button style="margin-left: 16px" @click="() => setFalse()">setFalse</vhp-button>
7+
<vhp-button @click="() => set(!flag)">set</vhp-button>
8+
<vhp-button style="margin-left: 8px" @click="() => setTrue()">setTrue</vhp-button>
9+
<vhp-button style="margin-left: 8px" @click="() => setFalse()">setFalse</vhp-button>
1010
</p>
1111
</div>
1212
</div>

packages/hooks/src/useCounter/demo/demo.vue

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
<vhp-button type="vhp-button" @click="inc()">
66
inc()
77
</vhp-button>
8-
<vhp-button type="vhp-button" @click="dec()">
8+
<vhp-button type="vhp-button" @click="dec()" style="margin-right: 8px">
99
dec()
1010
</vhp-button>
11-
<vhp-button type="vhp-button" @click="set(3)">
11+
<vhp-button type="vhp-button" @click="set(3)" style="margin-right: 8px">
1212
set(3)
1313
</vhp-button>
14-
<vhp-button type="vhp-button" @click="reset()">
14+
<vhp-button type="vhp-button" @click="reset()" style="margin-right: 8px">
1515
reset()
1616
</vhp-button>
1717
</div>
@@ -22,11 +22,3 @@
2222
import { useCounter } from 'vue-hooks-plus'
2323
const [current, { inc, dec, set, reset }] = useCounter(20, { min: 1, max: 10 })
2424
</script>
25-
26-
<style scoped lang="less">
27-
.contain {
28-
& > vhp-button {
29-
margin-right: 8px;
30-
}
31-
}
32-
</style>

packages/hooks/src/useDarkMode/demo/Test.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,3 @@
3131
},
3232
}
3333
</script>
34-
35-
<style scoped lang="less"></style>

packages/hooks/src/useDarkMode/demo/demo.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,3 @@
3131
},
3232
}
3333
</script>
34-
35-
<style scoped lang="less"></style>
Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
<template>
2-
<div>
3-
<input type="text" placeholder="输入" v-model="valueRef" />
4-
<p>500ms后变化:{{ debouncedValue }}</p>
5-
</div>
2+
<div>
3+
<input type="text" placeholder="输入" v-model="valueRef">
4+
<p>500ms后变化:{{ debouncedValue }}</p>
5+
</div>
66
</template>
77

88
<script lang="ts" setup>
9-
import { ref } from 'vue'
9+
import { ref } from 'vue'
1010
11-
import { useDebounce } from 'vue-hooks-plus'
12-
const valueRef = ref('')
11+
import { useDebounce } from 'vue-hooks-plus'
12+
const valueRef = ref('')
1313
14-
const debouncedValue = useDebounce(valueRef, { wait: 500 })
14+
const debouncedValue = useDebounce(valueRef, { wait: 500 })
1515
</script>
16-
<style scoped lang="less"></style>

packages/hooks/src/useDebounceFn/demo/demo.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,3 @@
1919
},
2020
)
2121
</script>
22-
<style scoped lang="less"></style>
Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,29 @@
11
<template>
2-
<div
3-
ref="dragRef"
4-
style="border:1px solid #e8e8e8; padding: 16px; width: 100px; text-align: center; margin-right: 16px;"
5-
>
6-
{{ dragging ? 'dragging' : `box-${data}` }}
7-
</div>
2+
<div
3+
ref="dragRef"
4+
style="border:1px solid #e8e8e8; padding: 16px; width: 100px; text-align: center; margin-right: 16px;"
5+
>
6+
{{ dragging ? 'dragging' : `box-${data}` }}
7+
</div>
88
</template>
99

1010
<script lang="ts" setup>
11-
import { ref } from 'vue'
11+
import { ref } from 'vue'
1212
13-
import { useDrag, useBoolean } from 'vue-hooks-plus'
13+
import { useDrag, useBoolean } from 'vue-hooks-plus'
1414
15-
const props = defineProps<{
16-
data?: string
17-
}>()
18-
const [dragging, { set: setDragging }] = useBoolean(false)
19-
const dragRef = ref(null)
15+
const props = defineProps<{
16+
data?: string
17+
}>()
18+
const [dragging, { set: setDragging }] = useBoolean(false)
19+
const dragRef = ref(null)
2020
21-
useDrag(props.data, dragRef, {
22-
onDragStart: () => {
23-
setDragging(true)
24-
},
25-
onDragEnd: () => {
26-
setDragging(false)
27-
},
28-
})
21+
useDrag(props.data, dragRef, {
22+
onDragStart: () => {
23+
setDragging(true)
24+
},
25+
onDragEnd: () => {
26+
setDragging(false)
27+
},
28+
})
2929
</script>
30-
31-
<style scoped lang="less"></style>

packages/hooks/src/useDrop/demo/demo.vue

Lines changed: 31 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -32,58 +32,42 @@ useDrag(props.data, dragRef, {
3232
-->
3333

3434
<template>
35-
<div>
36-
<div
37-
ref="dropRef"
38-
style=" border: 1px dashed #e8e8e8 ; padding: 16px; text-align: center;max-height: 400px;overflow-y: scroll;"
39-
>
40-
{{ isHovering ? 'release here' : 'drop here' }}
35+
<div>
36+
<div
37+
ref="dropRef"
38+
style=" border: 1px dashed #e8e8e8 ; padding: 16px; text-align: center;max-height: 400px;overflow-y: scroll;"
39+
>
40+
{{ isHovering ? 'release here' : 'drop here' }}
4141

42-
<p v-for="(item, index) in list" :key="index">{{ item }}</p>
43-
</div>
44-
<div style=" margin-top: 8px">
45-
<drag-demo
46-
v-for="item in [
47-
'1',
48-
'2',
49-
'3',
50-
'4',
51-
'5',
52-
'6',
53-
'7',
54-
'8',
55-
'9',
56-
'10',
57-
'11',
58-
'12',
59-
'13',
60-
]"
61-
:key="item"
62-
:data="item"
63-
/>
64-
</div>
65-
</div>
42+
<p v-for="(item, index) in list" :key="index">{{ item }}</p>
43+
</div>
44+
<div style=" margin-top: 8px">
45+
<drag-demo
46+
v-for="item in ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13']"
47+
:key="item"
48+
:data="item"
49+
/>
50+
</div>
51+
</div>
6652
</template>
6753

6854
<script lang="ts" setup>
69-
import { ref } from 'vue'
55+
import { ref } from 'vue'
7056
71-
import { useBoolean, useDrop } from 'vue-hooks-plus'
72-
import DragDemo from './DragDemo.vue'
57+
import { useBoolean, useDrop } from 'vue-hooks-plus'
58+
import DragDemo from './DragDemo.vue'
7359
74-
const dropRef = ref(null)
75-
const list = ref([])
76-
const [isHovering, { set: setIsHovering }] = useBoolean(false)
60+
const dropRef = ref(null)
61+
const list = ref([])
62+
const [isHovering, { set: setIsHovering }] = useBoolean(false)
7763
78-
useDrop(dropRef, {
79-
onDom: (content: string, e) => {
80-
// @ts-ignore
81-
list.value.push(`custom: ${content} dropped`)
82-
setIsHovering(false)
83-
},
84-
onDragEnter: () => setIsHovering(true),
85-
onDragLeave: () => setIsHovering(false),
86-
})
64+
useDrop(dropRef, {
65+
onDom: (content: string, e) => {
66+
// @ts-ignore
67+
list.value.push(`custom: ${content} dropped`)
68+
setIsHovering(false)
69+
},
70+
onDragEnter: () => setIsHovering(true),
71+
onDragLeave: () => setIsHovering(false),
72+
})
8773
</script>
88-
89-
<style scoped lang="less"></style>
Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,26 @@
11
<template>
2-
<div>A组件props event通信: {{ count }}</div>
3-
<div style="margin-top: 8px;">
4-
<a @click="changeGlobal">子组件A内进行全局</a>
5-
</div>
2+
<div>A组件props event通信: {{ count }}</div>
3+
<div style="margin-top: 8px;">
4+
<a @click="changeGlobal">子组件A内进行全局</a>
5+
</div>
66
</template>
77

88
<script lang="ts" setup>
9-
import { ref } from 'vue'
9+
import { ref } from 'vue'
1010
11-
import { useEventEmitter } from 'vue-hooks-plus'
11+
import { useEventEmitter } from 'vue-hooks-plus'
1212
13-
const event = useEventEmitter({ global: true })
14-
const props = defineProps<{
15-
event: any
16-
}>()
17-
const count = ref(0)
13+
const event = useEventEmitter({ global: true })
14+
const props = defineProps<{
15+
event: any
16+
}>()
17+
const count = ref(0)
1818
19-
props.event.useSubscription('change', () => {
20-
count.value += 1
21-
})
19+
props.event.useSubscription('change', () => {
20+
count.value += 1
21+
})
2222
23-
const changeGlobal = () => {
24-
event.emit('change')
25-
}
23+
const changeGlobal = () => {
24+
event.emit('change')
25+
}
2626
</script>
27-
28-
<style scoped lang="less"></style>
Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
<template>
2-
<div style="margin-top: 16px;">全局事件: {{ globalCount }}</div>
2+
<div style="margin-top: 16px;">全局事件: {{ globalCount }}</div>
33
</template>
44

55
<script lang="ts" setup>
6-
import { ref } from 'vue'
6+
import { ref } from 'vue'
77
8-
import { useEventEmitter } from 'vue-hooks-plus'
8+
import { useEventEmitter } from 'vue-hooks-plus'
99
10-
const event = useEventEmitter({ global: true })
11-
const globalCount = ref(0)
10+
const event = useEventEmitter({ global: true })
11+
const globalCount = ref(0)
1212
13-
event.useSubscription('change', () => {
14-
globalCount.value += 1
15-
})
13+
event.useSubscription('change', () => {
14+
globalCount.value += 1
15+
})
1616
</script>
17-
18-
<style scoped lang="less"></style>

packages/hooks/src/useEventEmitter/demo/demo.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,3 @@
3131
eventA.emit('change')
3232
}
3333
</script>
34-
35-
<style scoped lang="less"></style>
Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,23 @@
11
<template>
2-
<div>
3-
<div ref="divRef">点击我!</div>
4-
<br />
5-
<div>点击:{{ valueRef }}</div>
6-
</div>
2+
<div>
3+
<div ref="divRef">点击我!</div>
4+
<br>
5+
<div>点击:{{ valueRef }}</div>
6+
</div>
77
</template>
88

99
<script lang="ts" setup>
10-
import { ref } from 'vue'
11-
import { useEventListener } from 'vue-hooks-plus'
10+
import { ref } from 'vue'
11+
import { useEventListener } from 'vue-hooks-plus'
1212
13-
const divRef = ref()
14-
const valueRef = ref(0)
13+
const divRef = ref()
14+
const valueRef = ref(0)
1515
16-
useEventListener(
17-
'click',
18-
() => {
19-
valueRef.value += 1
20-
},
21-
{ target: divRef }
22-
)
16+
useEventListener(
17+
'click',
18+
() => {
19+
valueRef.value += 1
20+
},
21+
{ target: divRef },
22+
)
2323
</script>
24-
25-
<style scoped lang="less"></style>
Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
<template>
2-
<div>
3-
<div>窗口尺寸改变:{{ valueRef }}</div>
4-
</div>
2+
<div>
3+
<div>窗口尺寸改变:{{ valueRef }}</div>
4+
</div>
55
</template>
66

77
<script lang="ts" setup>
8-
import { ref } from 'vue'
9-
import { useEventListener } from 'vue-hooks-plus'
8+
import { ref } from 'vue'
9+
import { useEventListener } from 'vue-hooks-plus'
1010
11-
const valueRef = ref(0)
11+
const valueRef = ref(0)
1212
13-
useEventListener('resize', () => {
14-
valueRef.value += 1
15-
})
13+
useEventListener('resize', () => {
14+
valueRef.value += 1
15+
})
1616
</script>
17-
18-
<style scoped lang="less"></style>

packages/hooks/src/useExternal/demo/demo.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,3 @@
4343
}
4444
})
4545
</script>
46-
47-
<style scoped lang="less"></style>

packages/hooks/src/useExternal/demo/demo1.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,3 @@
2828
const path = ref('')
2929
const status = useExternal(path)
3030
</script>
31-
32-
<style scoped lang="less"></style>

packages/hooks/src/useFavicon/demo/Test.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,3 @@
3434
3535
useFavicon(url)
3636
</script>
37-
38-
<style scoped lang="less"></style>

0 commit comments

Comments
 (0)