mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-06-08 09:27:19 +08:00
perf: 优化size
自适应
This commit is contained in:
parent
bd2c0cba65
commit
0ccbb3f31c
@ -92,11 +92,15 @@ export default defineComponent({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleResizeInit() {
|
||||||
useResizeObserver(".pure-segmented", () => {
|
useResizeObserver(".pure-segmented", () => {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
handleInit(curIndex.value);
|
handleInit(curIndex.value);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
props.block && handleResizeInit();
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => curIndex.value,
|
() => curIndex.value,
|
||||||
@ -111,6 +115,11 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
watch(() => props.size, handleResizeInit, {
|
||||||
|
deep: true,
|
||||||
|
immediate: true
|
||||||
|
});
|
||||||
|
|
||||||
const rendLabel = () => {
|
const rendLabel = () => {
|
||||||
return props.options.map((option, index) => {
|
return props.options.map((option, index) => {
|
||||||
return (
|
return (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user