| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <template>
- <main>
- <div v-for="(item, key) in list" :key="key" @click="chooseNav(key)">
- <img :src="item.icon" />
- </div>
- </main>
- </template>
- <script>
- import { defineComponent, ref } from 'vue'
- export default defineComponent({
- components: {
- },
- props: ['index'],
- setup(props, {emit}) {
- const list = ref([
- {
- icon: new URL('@/assets/icons/riLine-wechat-line.svg',import.meta.url).href,
- type: 'wechat'
- },
- {
- icon: new URL('@/assets/icons/riLine-qr-code-line.svg',import.meta.url).href,
- title: 'qr',
- },
- {
- icon: new URL('@/assets/icons/riLine-time-line.svg',import.meta.url).href,
- title: 'record',
- }
- ]);
- const chooseNav = (index) => {
- emit('choose-nav', index);
- };
- return {
- list,
- chooseNav
- }
- }
- })
- </script>
- <style scoped>
- main {
- display: flex;
- >div {
- width: 24px;
- height: 24px;
- margin-right: 16px;
- display: flex;
- align-items: center;
- justify-content: center;
- cursor: pointer;
- border-radius: 4px;
- &:hover {
- background: rgba(229, 229, 229, 1);
- }
- }
- }
- </style>
|