clownshark5503
clownshark5503
Explore posts from servers
NNuxt
Created by clownshark5503 on 4/24/2024 in #❓・help
[Solved]Iterator is undefined in V-for
Hello! I have a drop down that's supposed to change based on the choice of a radio button. This works with a v-if="someOptionIsSelected" populate the dropdown with array1 v-else populate the dropdown with array2. However when I change the selection for the radio button option in v-for="option in array2" is undefined.
<select v-if="picked === 'Inn'" v-model="unitNum" aria-label="Default select example">
<option v-for="option in array1" :value="option.value" :key="option.text">
{{ option.text }}
</option>
</select>
<select v-else v-model="unitNum" aria-label="Default select example">
<option v-for="option in array2" :value="option.value" :key="option.text" >
{{ option.text }}
</option>
</select>
<select v-if="picked === 'Inn'" v-model="unitNum" aria-label="Default select example">
<option v-for="option in array1" :value="option.value" :key="option.text">
{{ option.text }}
</option>
</select>
<select v-else v-model="unitNum" aria-label="Default select example">
<option v-for="option in array2" :value="option.value" :key="option.text" >
{{ option.text }}
</option>
</select>
Does anyone understand whats going on? edit: Uncaught (in promise) TypeError: option is undefined
2 replies
CC#
Created by clownshark5503 on 2/17/2024 in #help
Unit Testing(post request) confusion with ActionResult[Solved]
No description
3 replies
NNuxt
Created by clownshark5503 on 6/20/2023 in #❓・help
GET request with strings causes 400 error
This call to my backend
const { data: result, error} = await useFetch(`https://localhost:7225/endpoint/gets/$(someInt}?date1=${this.DateArr[0]}&date2=${this.DateArr[1]}`,{headers})
const { data: result, error} = await useFetch(`https://localhost:7225/endpoint/gets/$(someInt}?date1=${this.DateArr[0]}&date2=${this.DateArr[1]}`,{headers})
The console says date1 and date2 are required. "The date1 field is required" Does anyone know whats up?
1 replies
CC#
Created by clownshark5503 on 6/15/2023 in #help
❔ My asp.net endpoint throws a error when it receives string
My endpoint takes a integer and 2 strings from the frontend. The frontend is sending a integer and 2 dates. Since these are typically turned into strings when you send it over and it throws a error about it I am rather lost.
[HttpGet("endpoint/{myInt}")]
public string MyFunc(int myInt, string s1, string s2){code}
[HttpGet("endpoint/{myInt}")]
public string MyFunc(int myInt, string s1, string s2){code}
Does anyone know what's going on?
4 replies
NNuxt
Created by clownshark5503 on 4/21/2023 in #❓・help
Popover works within the page but not within the component
I wish to have a popover appear when a user selects a certain radio button - I put the radio button selections in its own SFC but the pop doesn't work within the SFC. But if I put it in the page it works fine. My SFC contains the following: setup(){ const popoverTriggerList = document.querySelectorAll('[data-bs-toggle="popover"]') const popoverList = [...popoverTriggerList].map(popoverTriggerEl => new bootstrap.Popover(popoverTriggerEl)) } And the <template> <input type="radio" class="btn-check" name="options" id="option1" autocomplete="off" checked> <label class="btn btn-secondary" for="option1">Checked</label> <input type="radio" class="btn-check" name="options" id="option2" autocomplete="off" data-bs-container="body" data-bs-toggle="popover" data-bs-placement="right" data-bs-content="Popover Message" > <label class="btn btn-secondary" for="option2">Radio</label> In my page I have wrapped ClientOnly around the component. But the following radio selection I placed in the page of the component that works is: <div> <input type="radio" class="btn-check" name="options" id="option1" autocomplete="off" checked> <label class="btn btn-secondary" for="option1">Checked</label> <input type="radio" class="btn-check" name="options" id="option2" autocomplete="off" data-bs-container="body" data-bs-toggle="popover" data-bs-placement="right" data-bs-content="We cannot accomodate 5th Wheels longer than 40ft and Travel Trailers longer than 36ft" > <label class="btn btn-secondary" for="option2">Radio</label> I am using bootstrap and I have imported the component in the page. Can anyone help me get popover working within the component?
2 replies
NNuxt
Created by clownshark5503 on 4/4/2023 in #❓・help
$fetch with POST and same origin policy error
Hi everyone, I'm trying to make a POST request with $fetch to my backend(asp.net) but I consistently get this error message. Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://localhost:myport/myendpoint. (Reason: header ‘content-type’ is not allowed according to header ‘Access-Control-Allow-Headers’ from CORS preflight response). GET requests to my backend works. My backend CORS set up also should be permitting that the frontend makes this request. I wonder if my frontend being http:localhost:port/etc... and my backend being https:localhost:someport/etc has something to do with it but idk. Here's my function: async makeRes(){ const h = useRequestHeaders(['']) return await $fetch('https://localhost:port/myendpoint',{ headers:{ h }, method: 'POST', body:{ 'message': <my-data>, } }) } Whats yalls opinion?
3 replies