mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-06-08 01:17:23 +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", () => {
|
||||
nextTick(() => {
|
||||
handleInit(curIndex.value);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
props.block && handleResizeInit();
|
||||
|
||||
watch(
|
||||
() => curIndex.value,
|
||||
@ -111,6 +115,11 @@ export default defineComponent({
|
||||
}
|
||||
);
|
||||
|
||||
watch(() => props.size, handleResizeInit, {
|
||||
deep: true,
|
||||
immediate: true
|
||||
});
|
||||
|
||||
const rendLabel = () => {
|
||||
return props.options.map((option, index) => {
|
||||
return (
|
||||
|
Loading…
x
Reference in New Issue
Block a user