What is the best way to send multiple arguments or parameters to a function?

Currently, I am attempting to use a link to trigger a Vue function with three arguments/parameters. Unfortunately, the setup does not seem to be working as expected. Previously, it was functioning fine with only a single parameter.

Here is my current code:

<td>
  <a @click="delete('{{$detail->mainID}}, {{$detail->typeID }}, {{$detail->siteID}}')">Delete</a>
</td>

delete: function(mainID,typeID,siteID) {
    ...
}

I am seeking advice on how to correctly pass three arguments into my function. Any guidance would be greatly appreciated.

Answer №1

It appears there is an issue with your "a" tag. Make sure to properly separate your values as shown below:

<a @click="delete('{{$detail->mainID}}', '{{$detail->typeID }}', '{{$detail->siteID}}')">Delete</a>

Please remember to pay close attention to quotation marks.

Answer №2

Combining all parameters within a single quotation will result in them being treated as one combined parameter.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Hide the .prev button on the jQuery slider when it is on the first

Is there a way to hide the .prev button when it is the first one? Also, why does the slider go back to the first slide when the .prev button is clicked at the last slide? How can this issue be resolved? var nextPane = function (e) { e &&am ...

When integrating AngularJS with CKEditor, an error regarding module dependency injection may occur, causing the following message to be displayed:

Just starting out with Angularjs and attempting to integrate Ckeditor into my webapp. Currently encountering the following error: Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.5.8/$injector/modulerr?p0=editor&p1=Error%3A%…Flo ...

Is TinyMCE creating unexpected <g> tags?

When I save content in the TinyMCE WYSIWYG editor, I notice that the HTML tag below keeps appearing throughout the text: <g class="gr_ gr_283 gr-alert gr_spell gr_run_anim gr_inline_cards ContextualSpelling ins-del multiReplace" id="283" data-gr-id="28 ...

Construct object in JavaScript recursively

My current project involves creating a file structure index using nodeJS. I am utilizing the fs.readir function to iterate through files and it is working smoothly. However, I am facing an issue when it comes to descending into the directory structure and ...

If the width is below 767, the previous code will not be effective in jQuery

Challenge: How can I ensure that the code within the if statement only executes when the screen width exceeds 767px, and does not work if it is less than 767px? Using jQuery: $(document).ready(function() { $(window).resize(function() { if ($( ...

What is the best way to remove every other second and third element from an array?

I am looking to remove every second and third element of an array in Javascript. The array I am working with is as follows: var fruits = ["Banana", "yellow", "23", "Orange", "orange", "12", "Apple", "green", "10"]; My goal is to delete every second and ...

Having trouble rendering arrays and objects in Node, Express, and Jade?

//What is currently being passed to the Jade template exports.displayList = function(req, res){ res.render('report', {title: 'Custom Reports', rpts:[{uri:'/reports/allocation', title:'Allocation Report' ...

Issue with uploading images in Vue/Laravel: Unable to successfully transfer images to Laravel backend

Having trouble with image uploads in Laravel. The images are showing as an empty array: { "photo": {}, "nid": {}, "address": "Dhaka", "upazila": 493, "emergency_contact": "01719123886", "blood": "A__(positive)" } However, in Vue, w ...

Is there a way to dynamically fetch and run JavaScript code from the server without resorting to the use of the

In my current project, I am developing a unique PHP framework that empowers PHP developers to effortlessly craft ExtJS interfaces containing forms, grids, tabpanels, and menus exclusively through PHP classes. To illustrate, creating a TabPanel in this fra ...

Ensuring the validation of multiple ValidationObservers in Vue

In my ChangeInfo screen, I have three components representing ValidationObservers. When all three are valid, I set the variable showModal = true to display a success notification modal. However, if any of the three components have an error, showModal remai ...

What steps do I need to take to share my Node JS application on my local area network (

I have a Node.js application running on my Ubuntu machine successfully, as I can access it through localhost:8080. However, other machines on the network are unable to reach it. CODE: const portNumber = 8080 let app = express() app.use(express.static(__d ...

Angular appears to be having trouble with localStorage functionality

Having an issue with my service that interacts with a local NOTES object array using localStorage. Whenever the page refreshes, the previously entered data is lost and only the initial data in the const NOTES array remains. Can't seem to figure out wh ...

Troubleshooting the issue: AngularJS not functioning properly with radio button selection to show specific div containing input field

Looking for some help with radio buttons: I need the selection of radio buttons to display their respective input boxes. I have included a snippet of my HTML and controller code below. In my controller, I am using ng-change to call a function that uses jQu ...

Retrieve the complete content of a web page, including all HTML and JavaScript elements

After spending several hours researching and experimenting, I find myself a bit confused about the topic at hand. My issue: I am attempting to retrieve the complete HTML content (including dynamically generated JavaScript content) of a specific web page. ...

Access Java-generated cookies in JavaScript

I'm currently working on setting cookies using Java as demonstrated here. My goal is to utilize this cookie in JavaScript (it's necessary to do it this way due to certain limitations). However, I'm unable to detect any set cookies (using th ...

Which JSON JavaScript polyfill stands out as the top choice?

I'm currently in search of a JSON polyfill to enable JSON support on older browsers for my JavaScript code. After some research, it seems like JSON2 and JSON3 are popular choices, with JSON3 being positioned as an upgrade over JSON2. However, I'm ...

Experience the Power of Vue.js in Your Shopify Store

I have encountered an issue while attempting to integrate 3 custom modals into Shopify. Upon implementing them, I received the following error in the console (not originating from my Vue files, but rather from the Shopify template): [Vue warn]: Error comp ...

When a new component is loaded, React Martial UI component may face issues due to overwriting or

Currently, we are working on a vast web application that utilizes jquery and bootstrap. Our current task involves transitioning this extensive app to React with Material UI, piece by piece. As we progress towards transforming it into a React app, everythin ...

What is the process for switching from browser touch emulation mode to regular 'simple screen' display?

When booting from emulation mode in Chrome and then switching to normal mode, the console will display a 'touch' message. How can I display a simple screen instead? https://jsfiddle.net/dwfvb1hy/3/ function isTouchDevice() { if (isTouch) { ...

Condition-based React state counter starts updating

In my current project, I have developed the following React component: import React from "react"; import ReactDOM from "react-dom"; import { WidthProvider, Responsive } from "react-grid-layout"; import _ from "lodash"; const ResponsiveReactGridLayout = Wi ...