BobSty
BobSty
NNuxt
Created by BobSty on 4/28/2024 in #❓・help
Page wont redirect after parameter change
I hate myself rn
36 replies
NNuxt
Created by BobSty on 4/28/2024 in #❓・help
Page wont redirect after parameter change
I realized that there is an error in the code... which is only thrown on redirect, not thrown on refresh.... so thats why it did not work lol. I just wasted about 3 days for a fricking semicolon in the html code After removing the the semicolon, the code works flawless
36 replies
NNuxt
Created by BobSty on 4/28/2024 in #❓・help
Page wont redirect after parameter change
Ill try it tomorrow, thanks in advance
36 replies
NNuxt
Created by BobSty on 4/28/2024 in #❓・help
Page wont redirect after parameter change
Ah yeah you are right
36 replies
NNuxt
Created by BobSty on 4/28/2024 in #❓・help
Page wont redirect after parameter change
No description
36 replies
NNuxt
Created by BobSty on 4/28/2024 in #❓・help
Page wont redirect after parameter change
thanks
36 replies
NNuxt
Created by BobSty on 4/28/2024 in #❓・help
Page wont redirect after parameter change
I'm a little bit lost, I dont get where my mistake is
36 replies
NNuxt
Created by BobSty on 4/28/2024 in #❓・help
Page wont redirect after parameter change
I've changed the order of the files to following now:
- pages
-- dashboard
--- [serverId]
---- index.vue
---- [channelId]
----- index.vue
- pages
-- dashboard
--- [serverId]
---- index.vue
---- [channelId]
----- index.vue
I also changed it here: https://stackblitz.com/edit/github-ho2su4-dhgfkw?file=pages%2Fdashboard%2Findex.vue,components%2Fserver.vue,pages%2Fdashboard%2F[serverId]%2Findex.vue,pages%2Fdashboard%2F[serverId]%2F[channelId]%2Findex.vue,components%2Fservers.vue,components%2Fchannels.vue,components%2Fchannel.vue But the behaviour did not change
36 replies
NNuxt
Created by BobSty on 4/28/2024 in #❓・help
Page wont redirect after parameter change
Ill try to implement your code into mine
36 replies
NNuxt
Created by BobSty on 4/28/2024 in #❓・help
Page wont redirect after parameter change
No description
36 replies
NNuxt
Created by BobSty on 4/28/2024 in #❓・help
Page wont redirect after parameter change
sure
36 replies
NNuxt
Created by BobSty on 4/28/2024 in #❓・help
Page wont redirect after parameter change
This one? http://localhost:3000/dashboard/324141341234134/2312341351234 Its basically if I call http://localhost:3000/dashboard/324141341234134/ then the [serverId].vue component is redirected and if I press the button there which should redirect me to the [channelId].vue then the url looks like this http://localhost:3000/dashboard/324141341234134/2312341351234 but its not redirecting. However if I refresh the page now then the [channelId].vue component is displayed
36 replies
NNuxt
Created by BobSty on 4/28/2024 in #❓・help
Page wont redirect after parameter change
Yeah so the [servId] folder is the there to make the two URL parameters possible, if I name the folder [serverId] then the code wont work at all. Its currently working after a refresh.
36 replies
NNuxt
Created by BobSty on 4/28/2024 in #❓・help
Page wont redirect after parameter change
I've changed the files now:
// [serverId].vue

<template>
<navbar/>
<ueberschrift ueberschrift="Server Name TODO"/>
<channels :serverId="serverId"/>
<fusszeile/>
</template>

<script>
import channels from '/components/pages/dashboard/channels.vue'

export default {
computed: {
serverId() {
return this.$route.params.serverId
}
},
components: {
channels,
}
}
</script>
// [serverId].vue

<template>
<navbar/>
<ueberschrift ueberschrift="Server Name TODO"/>
<channels :serverId="serverId"/>
<fusszeile/>
</template>

<script>
import channels from '/components/pages/dashboard/channels.vue'

export default {
computed: {
serverId() {
return this.$route.params.serverId
}
},
components: {
channels,
}
}
</script>
// [channelId].vue

<template>
<navbar/>
<channeledit channelName="Channel1" :channelId="channelId" :serverId="serverId" />
<fusszeile/>
</template>

<script>
import channeledit from '/components/pages/dashboard/channeledit.vue'
export default {
computed: {
serverId() {
return this.$route.params.servId
},

channelId() {
return this.$route.params.channelId
}
},
components: {
channeledit,
}
}
</script>
// [channelId].vue

<template>
<navbar/>
<channeledit channelName="Channel1" :channelId="channelId" :serverId="serverId" />
<fusszeile/>
</template>

<script>
import channeledit from '/components/pages/dashboard/channeledit.vue'
export default {
computed: {
serverId() {
return this.$route.params.servId
},

channelId() {
return this.$route.params.channelId
}
},
components: {
channeledit,
}
}
</script>
But its still not redirecting the page to the [channelId].vue
36 replies
NNuxt
Created by BobSty on 4/28/2024 in #❓・help
Page wont redirect after parameter change
Alright I'll try to figure that out, thanks for your advice
36 replies
NNuxt
Created by BobSty on 4/28/2024 in #❓・help
Page wont redirect after parameter change
those are the sub components
// channels.vue

<style lang="css" scoped>
@import "/css/components/pages/dashboard/channels.css";
</style>

<template>
<div class="channels">
<div v-for="(channel) in dummyChannels">
<channel :channelName="channel.channelName" :channelId="channel.channelId" :serverId="serverId"/>
</div>
<createchannel channelName="New Creator Channel" :serverId="serverId" channelId="TODO"/>
</div>
</template>

<script>
import channel from '/components/pages/dashboard/channel.vue'
import createchannel from '/components/pages/dashboard/createchannel.vue'

export default {
data(){
return{
dummyChannels: [
{ channelName: "Channel1", channelId: '2312341351234' },
{ channelName: "Channel2", channelId: '3412341223531' },
{ channelName: "Channel3", channelId: '3154134233455' },
{ channelName: "Channel4", channelId: '2312341351234' },
{ channelName: "Channel5", channelId: '3412341223531' },
{ channelName: "Channel6", channelId: '3154134233455' }
]
}
},
props: {
serverId: String,
},
components: {
channel,
createchannel
}
};
</script>
// channels.vue

<style lang="css" scoped>
@import "/css/components/pages/dashboard/channels.css";
</style>

<template>
<div class="channels">
<div v-for="(channel) in dummyChannels">
<channel :channelName="channel.channelName" :channelId="channel.channelId" :serverId="serverId"/>
</div>
<createchannel channelName="New Creator Channel" :serverId="serverId" channelId="TODO"/>
</div>
</template>

<script>
import channel from '/components/pages/dashboard/channel.vue'
import createchannel from '/components/pages/dashboard/createchannel.vue'

export default {
data(){
return{
dummyChannels: [
{ channelName: "Channel1", channelId: '2312341351234' },
{ channelName: "Channel2", channelId: '3412341223531' },
{ channelName: "Channel3", channelId: '3154134233455' },
{ channelName: "Channel4", channelId: '2312341351234' },
{ channelName: "Channel5", channelId: '3412341223531' },
{ channelName: "Channel6", channelId: '3154134233455' }
]
}
},
props: {
serverId: String,
},
components: {
channel,
createchannel
}
};
</script>
// channel.vue

<style lang="css" scoped>
@import "/css/components/pages/dashboard/channel.css";
</style>

<template>
<div class="channel">
<div class="channel-name">
<h2>{{ channelName }}</h2>
<p>{{ channelId }}</p>
</div>
<div class="edit-button">
<NuxtLink :to="link" ><button>Edit</button></NuxtLink>
</div>
</div>
</template>

<script>
export default {
data() {
return {
link: "/dashboard/" + this.serverId + "/" + this.channelId
}
},
props: {
channelName: String,
channelId: String,
serverId: String
}
};
</script>
// channel.vue

<style lang="css" scoped>
@import "/css/components/pages/dashboard/channel.css";
</style>

<template>
<div class="channel">
<div class="channel-name">
<h2>{{ channelName }}</h2>
<p>{{ channelId }}</p>
</div>
<div class="edit-button">
<NuxtLink :to="link" ><button>Edit</button></NuxtLink>
</div>
</div>
</template>

<script>
export default {
data() {
return {
link: "/dashboard/" + this.serverId + "/" + this.channelId
}
},
props: {
channelName: String,
channelId: String,
serverId: String
}
};
</script>
36 replies
NNuxt
Created by BobSty on 4/28/2024 in #❓・help
Page wont redirect after parameter change
Actually its passed through with this into a sub component:
// [serverId].vue

<template>
<navbar/>
<ueberschrift ueberschrift="Server Name TODO"/>
<channels :serverId="serverId"/>
<fusszeile/>
</template>

<script>
import channels from '/components/pages/dashboard/channels.vue'

export default {
data() {
return {
serverId: this.$route.params.serverId
}
},
components: {
channels,
}
}
</script>
// [serverId].vue

<template>
<navbar/>
<ueberschrift ueberschrift="Server Name TODO"/>
<channels :serverId="serverId"/>
<fusszeile/>
</template>

<script>
import channels from '/components/pages/dashboard/channels.vue'

export default {
data() {
return {
serverId: this.$route.params.serverId
}
},
components: {
channels,
}
}
</script>
And then passed further via props, the channelId depends on the button which the user clicks in the component
36 replies
NNuxt
Created by BobSty on 4/28/2024 in #❓・help
Page wont redirect after parameter change
The code is from the [serverId].vue
36 replies
NNuxt
Created by BobSty on 4/24/2024 in #❓・help
Event is triggered twice
Okay, I'm kinda stupid on this one, so the solution is simply to check which instance of the input is currently in use and if the input is not the instance which I want to add the text to simply exit the function. I had 2 instances of the input in use so the event would be send to both of them and the input would always be added from both instances.
2 replies
NNuxt
Created by BobSty on 4/4/2024 in #❓・help
Auth with Discord
thanks
5 replies