Skip to content
Snippets Groups Projects
Commit 21c9705a authored by syuilo's avatar syuilo
Browse files

wip: refactor(client): migrate components to composition api

parent daba865a
No related branches found
No related tags found
No related merge requests found
<template> <template>
<div class="hpaizdrt" :style="bg"> <div class="hpaizdrt" :style="bg">
<img v-if="info.faviconUrl" class="icon" :src="info.faviconUrl"/> <img v-if="instance.faviconUrl" class="icon" :src="instance.faviconUrl"/>
<span class="name">{{ info.name }}</span> <span class="name">{{ instance.name }}</span>
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts" setup>
import { defineComponent } from 'vue'; import { } from 'vue';
import { instanceName } from '@/config';
const props = defineProps<{
export default defineComponent({ instance: any; // TODO
props: { }>();
instance: {
type: Object, const themeColor = props.instance.themeColor || '#777777';
required: false
}, const bg = {
}, background: `linear-gradient(90deg, ${themeColor}, ${themeColor + '00'})`
};
data() {
return {
info: this.instance || {
faviconUrl: '/favicon.ico',
name: instanceName,
themeColor: (document.querySelector('meta[name="theme-color-orig"]') as HTMLMetaElement)?.content
}
}
},
computed: {
bg(): any {
const themeColor = this.info.themeColor || '#777777';
return {
background: `linear-gradient(90deg, ${themeColor}, ${themeColor + '00'})`
};
}
}
});
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment