papayaui 0.2.19 → 0.2.20
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.
|
@@ -14,6 +14,10 @@
|
|
|
14
14
|
<DocDemoBlock title="自定义标题内容">
|
|
15
15
|
<Demo4 />
|
|
16
16
|
</DocDemoBlock>
|
|
17
|
+
|
|
18
|
+
<DocDemoBlock title="嵌套使用">
|
|
19
|
+
<Demo5 />
|
|
20
|
+
</DocDemoBlock>
|
|
17
21
|
<pa-safe-bottom />
|
|
18
22
|
</template>
|
|
19
23
|
|
|
@@ -23,6 +27,7 @@ import Demo1 from '../../demos/collapse/demo-1.vue'
|
|
|
23
27
|
import Demo2 from '../../demos/collapse/demo-2.vue'
|
|
24
28
|
import Demo3 from '../../demos/collapse/demo-3.vue'
|
|
25
29
|
import Demo4 from '../../demos/collapse/demo-4.vue'
|
|
30
|
+
import Demo5 from '../../demos/collapse/demo-5.vue'
|
|
26
31
|
</script>
|
|
27
32
|
|
|
28
33
|
<style lang="scss" scoped></style>
|
|
@@ -41,8 +41,8 @@ import useNamespace from '../../core/useNamespace'
|
|
|
41
41
|
import { useRect } from '../../hooks'
|
|
42
42
|
import { getParentInstance } from '../../utils/component'
|
|
43
43
|
import Cell from '../cell/cell.vue'
|
|
44
|
-
import { CollapseExpose, CollapseProps } from '../collapse'
|
|
45
|
-
import { collapseItemProps, CollapseItemValue } from './props'
|
|
44
|
+
import type { CollapseExpose, CollapseProps } from '../collapse'
|
|
45
|
+
import { collapseItemProps, type CollapseItemValue } from './props'
|
|
46
46
|
|
|
47
47
|
const ns = useNamespace('collapse-item')
|
|
48
48
|
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
:use-slot="!!$slots.default"
|
|
38
38
|
:custom-class="itemClass"
|
|
39
39
|
:custom-style="itemStyle"
|
|
40
|
-
@click="onSelect(item[valueKey])"
|
|
40
|
+
@click="onSelect(item[valueKey], item)"
|
|
41
41
|
>
|
|
42
42
|
<slot v-if="$slots.default" :item="item" :isCreate="!!item.__isCreate" />
|
|
43
43
|
</ListItem>
|
|
@@ -221,13 +221,13 @@ const onCreate = async () => {
|
|
|
221
221
|
}
|
|
222
222
|
newOption.__isCreate = true
|
|
223
223
|
createOptions.value.unshift(newOption)
|
|
224
|
-
onSelect(searchText.value)
|
|
224
|
+
onSelect(searchText.value, newOption)
|
|
225
225
|
emit('create', searchText.value)
|
|
226
226
|
onClearSearch()
|
|
227
227
|
}
|
|
228
228
|
|
|
229
|
-
const onSelect = async (value: OptionValue) => {
|
|
230
|
-
emit('select', value)
|
|
229
|
+
const onSelect = async (value: OptionValue, item: Option) => {
|
|
230
|
+
emit('select', value, item)
|
|
231
231
|
if (_onSelect(value) && !showView.value.confirm) {
|
|
232
232
|
onOk()
|
|
233
233
|
}
|
|
@@ -125,7 +125,7 @@ export const pickerPopupEmits = {
|
|
|
125
125
|
...bottomPopupEmits,
|
|
126
126
|
'update:modelValue': (value: OptionValue | OptionValue[]) =>
|
|
127
127
|
isString(value) || isNumber(value) || isArray(value),
|
|
128
|
-
select: (
|
|
128
|
+
select: (value: OptionValue, _item: Option) => !isUndefined(value),
|
|
129
129
|
change: (item: Option | Option[]) => !isUndefined(item),
|
|
130
130
|
/**
|
|
131
131
|
* 新增选项
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<pa-collapse v-model="collapseValue">
|
|
3
|
+
<pa-collapse-item title="测试" :border="false">
|
|
4
|
+
<pa-collapse v-model="collapseChildValue" :border="false">
|
|
5
|
+
<pa-collapse-item title="嵌套测试" :border="false">
|
|
6
|
+
嵌套内容,嵌套内容,嵌套内容
|
|
7
|
+
</pa-collapse-item>
|
|
8
|
+
</pa-collapse>
|
|
9
|
+
<view>测试内容,测试内容,测试内容</view>
|
|
10
|
+
</pa-collapse-item>
|
|
11
|
+
</pa-collapse>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script setup lang="ts">
|
|
15
|
+
import { ref } from 'vue'
|
|
16
|
+
|
|
17
|
+
const collapseValue = ref<number[]>([])
|
|
18
|
+
const collapseChildValue = ref<number[]>([])
|
|
19
|
+
</script>
|