在做collapse组件时,用到这个功能,结果答案基本一致。 思路基本如下: clone element append to body show the hide element get the property remove the clone element 参考 StackOverflow StackOverflow