improvements to immersive fs, moved sidebar-library-item to its own js component

This commit is contained in:
booploops 2022-06-30 01:12:19 -07:00
parent 31af264c7a
commit b7d3831b57
6 changed files with 92 additions and 53 deletions

View file

@ -0,0 +1,46 @@
import {html} from "../html.js"
export const sidebarLibraryItem = Vue.component("sidebar-library-item", {
template: html`
<button class="app-sidebar-item"
:class="$root.getSidebarItemClass(page)" @click="$root.setWindowHash(page)">
<svg-icon :url="svgIconData" :name="'sidebar-' + svgIconName" v-if="svgIconData != ''"/>
<span class="sidebar-item-text">{{ name }}</span>
</button>
`,
props: {
name: {
type: String,
required: true,
},
page: {
type: String,
required: true,
},
svgIcon: {
type: String,
required: false,
default: "",
},
svgIconName: {
type: String,
required: false
},
cdClick: {
type: Function,
required: false,
},
},
data: function () {
return {
app: app,
svgIconData: "",
};
},
async mounted() {
if (this.svgIcon) {
this.svgIconData = this.svgIcon;
}
},
methods: {},
})