下面是文字伸展的基础用法。
<template> <div class="t-text-expand-area"> <div class="btn-area"> <button class="show-btn" @click="showText">显示文字</button> <button class="hide-btn" @click="hideText">隐藏文字</button> </div> <div class="text-area" v-if="textExpandShow"> <as-animation-text-expand> </as-animation-text-expand> </div> </div> </template> <script> export default { name: "t-text-expand", data(){ return{ textExpandShow:false, } }, methods:{ showText(){ this.textExpandShow=true; }, hideText(){ this.textExpandShow=false; }, } } </script> <style> .t-text-expand-area .btn-area{ width: 100%; height: 60px; display: flex; flex-direction: row; align-items: center; } .t-text-expand-area .btn-area button{ background-color: dodgerblue; border-radius: 5px; width: 100px; height: 40px; outline: none; border: none; color: #ffffff; } .t-text-expand-area .btn-area .hide-btn{ margin-left: 20px; } </style>
← 文字阴影 视差滚动 →