mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
chore(ActionBarButton): use tsx (#8070)
This commit is contained in:
parent
1b5da21ee8
commit
66963db3ed
@ -1,4 +1,4 @@
|
|||||||
import { computed } from 'vue';
|
import { computed, PropType } from 'vue';
|
||||||
import { createNamespace } from '../utils';
|
import { createNamespace } from '../utils';
|
||||||
import { ACTION_BAR_KEY } from '../action-bar';
|
import { ACTION_BAR_KEY } from '../action-bar';
|
||||||
|
|
||||||
@ -8,14 +8,14 @@ import { useExpose } from '../composables/use-expose';
|
|||||||
import { useRoute, routeProps } from '../composables/use-route';
|
import { useRoute, routeProps } from '../composables/use-route';
|
||||||
|
|
||||||
// Components
|
// Components
|
||||||
import Button from '../button';
|
import Button, { ButtonType } from '../button';
|
||||||
|
|
||||||
const [createComponent, bem] = createNamespace('action-bar-button');
|
const [createComponent, bem] = createNamespace('action-bar-button');
|
||||||
|
|
||||||
export default createComponent({
|
export default createComponent({
|
||||||
props: {
|
props: {
|
||||||
...routeProps,
|
...routeProps,
|
||||||
type: String,
|
type: String as PropType<ButtonType>,
|
||||||
text: String,
|
text: String,
|
||||||
icon: String,
|
icon: String,
|
||||||
color: String,
|
color: String,
|
||||||
@ -29,14 +29,14 @@ export default createComponent({
|
|||||||
|
|
||||||
const isFirst = computed(() => {
|
const isFirst = computed(() => {
|
||||||
if (parent) {
|
if (parent) {
|
||||||
const prev = parent.children[index.value - 1];
|
const prev = parent.children[index!.value - 1];
|
||||||
return !(prev && 'isButton' in prev);
|
return !(prev && 'isButton' in prev);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const isLast = computed(() => {
|
const isLast = computed(() => {
|
||||||
if (parent) {
|
if (parent) {
|
||||||
const next = parent.children[index.value + 1];
|
const next = parent.children[index!.value + 1];
|
||||||
return !(next && 'isButton' in next);
|
return !(next && 'isButton' in next);
|
||||||
}
|
}
|
||||||
});
|
});
|
Loading…
x
Reference in New Issue
Block a user