Home >
front end > The same hook function in the condition of the vue animation rendering/conditions to show the result
The same hook function in the condition of the vue animation rendering/conditions to show the result
Code:
<meta charset="utf-8"/& gt;
<script SRC="https://cdn.jsdelivr.net/npm/vue/dist/vue.js" & gt; </script>
<style>
HTML,
Body {
Padding: 0 px;
margin: 0px;
}
</style>
<body>
@ before - enter="beforeEnter
"@ enter="enter"
@ after - enter="afterEnter
">
: style="{height: '20 px, width:' 20 px ', 'border - the radius' :' 50% ', 'background - color:' red '}"
V - show="show"
@ before - enter="beforeEnter2
"@ enter="enter2"
@ after - enter="afterEnter2
">
: style="{height: '20 px, width:' 20 px ', 'border - the radius' :' 50% ', 'background - color:' blue '}"
V - if="show"
Var=new vm Vue ({
El: "# app,"
Data: {
Show: false,
},
Methods: {
BeforeEnter: function (el) {
The console. The log (" beforeEnter ");
},
BeforeEnter2: function (el) {
The console. The log (" beforeEnter2 ");
El. Style. The transform="translate" (0, 0).
},
Enter: function (el) {
The console. The log (" enter ");
El. Style. The transform="translate (0300 px)";
},
Enter2: function (el) {
The console. The log (" enter2 ");
El. OffsetWidth;
El. Style. The transform="translate (150 px, 150 px)";
El. Style. The transition="all 1 s ease";
},
AfterEnter: function (el) {
The console. The log (" afterEnter ");
El. Style. The transform="translate (150 px, 150 px)";
El. Style. The transition="all 1 s ease";
},
AfterEnter2: function (el) {
The console. The log (" afterEnter2 ");
},
},
});
</script>