improvements to immersive fs, moved sidebar-library-item to its own js component
This commit is contained in:
parent
31af264c7a
commit
b7d3831b57
6 changed files with 92 additions and 53 deletions
46
src/renderer/main/components/sidebar-library-item.js
Normal file
46
src/renderer/main/components/sidebar-library-item.js
Normal 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: {},
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue