
鼠标在圆圈位置的放大效果

这里使用的组件库为contextmenu-ui组件库
安装方式:
npm i contextmenu-ui
引用方式:
- // main.js
-
- import App from './App.vue'
- import VueTestUI from 'contextmenu-ui/dist/contextmenu-ui.umd.cjs'
- import 'contextmenu-ui/dist/index.css'
-
- const app = createApp(App)
- app.use(VueTestUI);
所用的组件则是其中的ZsTab组件,这里直接上代码
- <template>
- <div>
- <ZsTab :active-name="activeName" :is-trans="true">
- <ZsTabPane name="first">ZsTabPane>
- <ZsTabPane name="second">ZsTabPane>
- <ZsTabPane name="third">ZsTabPane>
- <ZsTabPane name="fourth">ZsTabPane>
- <ZsTabPane name="fifth">ZsTabPane>
- <ZsTabPane name="sixth">ZsTabPane>
- <ZsTabPane name="seventh">ZsTabPane>
- ZsTab>
- div>
- template>
- <script setup>
- import { ref } from 'vue'
- const activeName = ref('first')
- script>
直接在ZsTabPane标签中填充内容即可,其中is-trans属性最好设置为true,这个组件的放大效果还不错,但是当ZsTabPane组件的内容单位为px时,其放大效果会有些问题,后续需要继续改进。
这里是组件的参数:

