Authored by 陈峰

commit

... ... @@ -28,7 +28,6 @@
</template>
<script>
import anime from 'animejs';
import {createNamespacedHelpers} from 'vuex';
const {mapMutations, mapState} = createNamespacedHelpers('article');
... ... @@ -116,6 +115,9 @@ export default {
type: this.type
});
}
import('animejs').then(({default: anime}) => {
this.anime = anime;
});
},
methods: {
...mapMutations(['CHANGE_ARTICLE_LIST_INTRO_HEIGHT', 'CHANGE_ARTICLE_LIST_INTRO']),
... ... @@ -144,13 +146,16 @@ export default {
if (!this.isEllipsis) {
return;
}
if (!this.anime) {
return;
}
const isExpand = !this.data.isExpand;
const height = isExpand ? this.data.introHeight : this.introCollapseHeight;
this.$emit('on-expanding');
this.isPreExpand = isExpand;
anime({
this.anime({
targets: this.$refs.intro,
height,
easing: 'cubicBezier(0.165, 0.84, 0.44, 1)',
... ...