working on plugin pages

This commit is contained in:
booploops 2022-03-08 02:26:47 -08:00
parent 10435d5b7c
commit bd4a2e7d27
4 changed files with 40 additions and 2 deletions

View file

@ -60,6 +60,7 @@ export class BrowserWindow {
"pages/replay",
"pages/audiolabs",
"pages/zoo",
"pages/plugin-renderer",
"components/mediaitem-artwork",
"components/artwork-material",
"components/menu-panel",
@ -90,8 +91,14 @@ export class BrowserWindow {
"components/miniplayer",
"components/castmenu",
"components/artist-chip",
"components/hello-world",
],
appRoutes: [
{
page: "plugin-renderer",
component: `<plugin-renderer></plugin-renderer>`,
condition: "page == 'plugin-renderer'"
},
{
page: "zoo",
component: "<cider-zoo></cider-zoo>",

View file

@ -217,7 +217,11 @@ const app = new Vue({
}
},
pauseButtonTimer: null,
activeCasts: []
activeCasts: [],
pluginPages: {
page: "hello-world",
pages: [],
}
},
watch: {
cfg: {
@ -1488,6 +1492,11 @@ const app = new Vue({
let page = hash[0]
let id = hash[1]
let isLibrary = hash[2] ?? false
if(page == "plugin") {
this.pluginPages.page = "plugin." + id
this.page = "plugin-renderer"
return
}
this.routeView({
kind: page,
id: id,

View file

@ -3,7 +3,7 @@
</script>
<script>
Vue.component('hello-world', {
var hw = Vue.component('hello-world', {
template: '#hello-world',
methods: {
sayHello: function () {

View file

@ -0,0 +1,22 @@
<script>
Vue.component('plugin-renderer', {
/*html*/
template: `
<component :is="getPage()"></component>
`,
data: function () {
return {
app: this.$root,
}
},
props: {},
mounted() {
},
methods: {
getPage() {
return this.$root.pluginPages.page
}
},
}
);
</script>