Vue平滑重排可让您在数据更改时过渡元素重排。
更改组件数据后,您注册的所有CSS属性都将转换为其新值。
# NPM
$ npm install vue-smooth-reflow --save
模块:
<template>
<div>
<div v-for="n in children" />
</div>
</template>
<script>
// 组件的根el现在将转换到
// 适应“this.children”的新价
import smoothReflow from 'vue-smooth-reflow'
export default {
mixins: [smoothReflow],
data() {
return {
children: '<Dynamic value>'
}
},
mounted(){
this.$smoothReflow()
},
}
</script>