index.vue 450 B

123456789101112131415161718192021
  1. <template>
  2. <span v-if="theme.showTheme">
  3. <vab-icon icon="t-shirt-line" @click="handleOpenTheme" />
  4. </span>
  5. </template>
  6. <script lang="ts" setup>
  7. import { useSettingsStore } from '/@/store/modules/settings'
  8. defineOptions({
  9. name: 'VabTheme',
  10. })
  11. const $pub = inject<any>('$pub')
  12. const settingsStore = useSettingsStore()
  13. const { theme } = storeToRefs(settingsStore)
  14. const handleOpenTheme = () => {
  15. $pub('shop-vite-open-theme')
  16. }
  17. </script>