vue warn - Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-rendersAvoid mutating a prop directly since the value will be overwrittenGetting avoid mutating a prop directly since the value will be overwritten whenever the parent component re-rendersHow to solve [Vue warn]: Avoid mutating a prop directly since the value will be overwritten on vue.js 2?Avoid mutating a prop directly in VueJS 2“Avoid mutating a prop” warning in vue-chartjs component when prop never changesVue2: warning: Avoid mutating a prop directlyAvoid mutating a prop : vuejs 2Vue closing component returns avoid mutating a prop directly[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-rendersMutating props in child component
Substitution failure with `std::function` and previously deduced template parameter - why?
Driving test in New Zealand?
How does case-insensitive collation work?
Can I voluntarily exit from the US after a 20 year overstay, or could I be detained at the airport?
Is right click on tables bad UX
Can Fabled Passage generate two mana with Amulet of Vigor?
Manager told a colleague of mine I was getting fired soon
Generating Roman numerals with dice
Why is the time of useful consciousness only seconds at high altitudes?
Quote to show students don't have to fear making mistakes
How to explain that the sums of numerators over sums of denominators isn't the same as the mean of ratios?
How to cope with being on standby
What are some ways to season that don't rely on garlic and onions?
Non-electric Laser
As an interviewer, how to conduct interviews with candidates you already know will be rejected?
Young adult short story book with one story where a woman finds a walrus suit and becomes a walrus
C - Learning Linked Lists, Pointer Manipulation - Store some ints, print and free memory
Why do many websites hide input when entering a OTP
What would the EU’s position be with respect to a United Ireland?
I've been fired, was allowed to announce it as if I quit and given extra notice, how to handle the questions?
Is there a pattern for handling conflicting function parameters?
"Categorical" Schröder–Bernstein theorem?
Why do personal finance apps focus on outgoings rather than income
How to "Start as close to the end as possible", and why to do so?
vue warn - Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders
Avoid mutating a prop directly since the value will be overwrittenGetting avoid mutating a prop directly since the value will be overwritten whenever the parent component re-rendersHow to solve [Vue warn]: Avoid mutating a prop directly since the value will be overwritten on vue.js 2?Avoid mutating a prop directly in VueJS 2“Avoid mutating a prop” warning in vue-chartjs component when prop never changesVue2: warning: Avoid mutating a prop directlyAvoid mutating a prop : vuejs 2Vue closing component returns avoid mutating a prop directly[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-rendersMutating props in child component
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;
Here, I have a variable called total_price
which I sent from laravel. I wanna do many things to it. When I use methods, when script runs them, I get the mutating error
. Here is the script:
export default {
props:
.//some other props here are cut for better reading
.
.
total_price:
type:Number
,
.
.
.
,
data()
return
newValue:7,
total_price:1,
,
I use them in methods like this:
methods:
getNotificationClass (notification)
return `alert alert-$notification.type`
,
mpminus: function ()
if ((this.newValue) > this.min)
this.newValue = this.newValue - 1
this.$emit('input', this.newValue)
if(this.newValue < this.max_occupancy)
this.total_price = this.extra_price / ( this.newValue - this.base_capacity )
this.person_number =this.newValue - this.base_capacity
this.$emit('input', this.totalprice)
this.$emit('input', this.person_number)
,
mpplus: function () ,
,
...using this template:
<div class="minusplusnumber">
<div class="mpbtn minus" v-on:click="mpminus()">
-
</div>
<div id="field_container">
<input type="number" v-model="newValue" disabled />
</div>
<div class="mpbtn plus" v-on:click="mpplus()">
+
</div>
</div>
When I click minus
or plus
, I get this warning:
[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value. Prop being mutated: "total_price"
found in
---> <Reserve> at resources/js/components/Reserve.vue
<Root>
javascript vue.js
add a comment
|
Here, I have a variable called total_price
which I sent from laravel. I wanna do many things to it. When I use methods, when script runs them, I get the mutating error
. Here is the script:
export default {
props:
.//some other props here are cut for better reading
.
.
total_price:
type:Number
,
.
.
.
,
data()
return
newValue:7,
total_price:1,
,
I use them in methods like this:
methods:
getNotificationClass (notification)
return `alert alert-$notification.type`
,
mpminus: function ()
if ((this.newValue) > this.min)
this.newValue = this.newValue - 1
this.$emit('input', this.newValue)
if(this.newValue < this.max_occupancy)
this.total_price = this.extra_price / ( this.newValue - this.base_capacity )
this.person_number =this.newValue - this.base_capacity
this.$emit('input', this.totalprice)
this.$emit('input', this.person_number)
,
mpplus: function () ,
,
...using this template:
<div class="minusplusnumber">
<div class="mpbtn minus" v-on:click="mpminus()">
-
</div>
<div id="field_container">
<input type="number" v-model="newValue" disabled />
</div>
<div class="mpbtn plus" v-on:click="mpplus()">
+
</div>
</div>
When I click minus
or plus
, I get this warning:
[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value. Prop being mutated: "total_price"
found in
---> <Reserve> at resources/js/components/Reserve.vue
<Root>
javascript vue.js
1
What is the name of the component (the name of the.vue
file)? Try removing thetotal_price: type:Number ,
from theprops
part, keep it only ondata()
. Does it still work?
– acdcjunior
Mar 28 at 21:19
2
The warning is clear enough. Just make a copy oftotal_price
in thecreated()
function and make changes to that copy.
– edwin
Mar 28 at 21:37
add a comment
|
Here, I have a variable called total_price
which I sent from laravel. I wanna do many things to it. When I use methods, when script runs them, I get the mutating error
. Here is the script:
export default {
props:
.//some other props here are cut for better reading
.
.
total_price:
type:Number
,
.
.
.
,
data()
return
newValue:7,
total_price:1,
,
I use them in methods like this:
methods:
getNotificationClass (notification)
return `alert alert-$notification.type`
,
mpminus: function ()
if ((this.newValue) > this.min)
this.newValue = this.newValue - 1
this.$emit('input', this.newValue)
if(this.newValue < this.max_occupancy)
this.total_price = this.extra_price / ( this.newValue - this.base_capacity )
this.person_number =this.newValue - this.base_capacity
this.$emit('input', this.totalprice)
this.$emit('input', this.person_number)
,
mpplus: function () ,
,
...using this template:
<div class="minusplusnumber">
<div class="mpbtn minus" v-on:click="mpminus()">
-
</div>
<div id="field_container">
<input type="number" v-model="newValue" disabled />
</div>
<div class="mpbtn plus" v-on:click="mpplus()">
+
</div>
</div>
When I click minus
or plus
, I get this warning:
[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value. Prop being mutated: "total_price"
found in
---> <Reserve> at resources/js/components/Reserve.vue
<Root>
javascript vue.js
Here, I have a variable called total_price
which I sent from laravel. I wanna do many things to it. When I use methods, when script runs them, I get the mutating error
. Here is the script:
export default {
props:
.//some other props here are cut for better reading
.
.
total_price:
type:Number
,
.
.
.
,
data()
return
newValue:7,
total_price:1,
,
I use them in methods like this:
methods:
getNotificationClass (notification)
return `alert alert-$notification.type`
,
mpminus: function ()
if ((this.newValue) > this.min)
this.newValue = this.newValue - 1
this.$emit('input', this.newValue)
if(this.newValue < this.max_occupancy)
this.total_price = this.extra_price / ( this.newValue - this.base_capacity )
this.person_number =this.newValue - this.base_capacity
this.$emit('input', this.totalprice)
this.$emit('input', this.person_number)
,
mpplus: function () ,
,
...using this template:
<div class="minusplusnumber">
<div class="mpbtn minus" v-on:click="mpminus()">
-
</div>
<div id="field_container">
<input type="number" v-model="newValue" disabled />
</div>
<div class="mpbtn plus" v-on:click="mpplus()">
+
</div>
</div>
When I click minus
or plus
, I get this warning:
[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value. Prop being mutated: "total_price"
found in
---> <Reserve> at resources/js/components/Reserve.vue
<Root>
javascript vue.js
javascript vue.js
edited Mar 28 at 21:51
Philosophist
10512 bronze badges
10512 bronze badges
asked Mar 28 at 21:11
FarshadFarshad
4943 silver badges19 bronze badges
4943 silver badges19 bronze badges
1
What is the name of the component (the name of the.vue
file)? Try removing thetotal_price: type:Number ,
from theprops
part, keep it only ondata()
. Does it still work?
– acdcjunior
Mar 28 at 21:19
2
The warning is clear enough. Just make a copy oftotal_price
in thecreated()
function and make changes to that copy.
– edwin
Mar 28 at 21:37
add a comment
|
1
What is the name of the component (the name of the.vue
file)? Try removing thetotal_price: type:Number ,
from theprops
part, keep it only ondata()
. Does it still work?
– acdcjunior
Mar 28 at 21:19
2
The warning is clear enough. Just make a copy oftotal_price
in thecreated()
function and make changes to that copy.
– edwin
Mar 28 at 21:37
1
1
What is the name of the component (the name of the
.vue
file)? Try removing the total_price: type:Number ,
from the props
part, keep it only on data()
. Does it still work?– acdcjunior
Mar 28 at 21:19
What is the name of the component (the name of the
.vue
file)? Try removing the total_price: type:Number ,
from the props
part, keep it only on data()
. Does it still work?– acdcjunior
Mar 28 at 21:19
2
2
The warning is clear enough. Just make a copy of
total_price
in the created()
function and make changes to that copy.– edwin
Mar 28 at 21:37
The warning is clear enough. Just make a copy of
total_price
in the created()
function and make changes to that copy.– edwin
Mar 28 at 21:37
add a comment
|
1 Answer
1
active
oldest
votes
Here is an example of how to use props along with mutation - this is a good way of summarizing what you are trying to accomplish..
Just change the number in :default-value=X
to simulate passing down a prop..
Full Link:
https://codepen.io/oze4/pen/PLMEab
HTML:
<!-- Main Vue instance (aka parent) -->
<div id="app">
<!-- ----------------------------------------- -->
<!-- CHANGE THE NUMBER 10 TO WHATEVER YOU WANT -->
<!-- ----------------------------------------- -->
<my-counter :default-value=10></my-counter>
</div>
<!-- Child component as x-template component -->
<script type="text/x-template" id="counter">
<div>
<div style="border: 1px solid black; width: 250px; margin: 40px 40px 40px 40px">
<v-btn @click="increase" color="blue">Increase</v-btn>
<v-btn @click="decrease" color="red">Decrease</v-btn>
</div>
<div>
<div>
<h3 style="margin-left: 40px;">Current Count: currentValue </h3>
</div>
</div>
</div>
</script>
JS/Vue
/**
* Child component as x-template
*/
const appCounter =
template: '#counter',
props:
defaultValue:
type: Number,
default: 0
,
data()
return
currentValue: '',
,
mounted()
this.currentValue = this.defaultValue;
,
methods:
increase()
this.currentValue++;
,
decrease()
this.currentValue--;
/**
* Main Vue Instance
*/
new Vue(
el: "#app",
components:
myCounter: appCounter
);
all that matters is to use that value in mounted functin to pass it up yes ??ofc i dont know why i get this error because i have just one component as the vue inspector shows me 2 ofc but i dont send data to secound one
– Farshad
Mar 29 at 6:33
1
You get that error because you are directly modifying a prop. This line:this.total_price = this.extra_price / ( this.newValue - this.base_capacity)
You need to grab the value of that prop and mutate it inside ofdata
.
– Matt Oestreich
Mar 29 at 11:55
add a comment
|
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55406907%2fvue-warn-avoid-mutating-a-prop-directly-since-the-value-will-be-overwritten-wh%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Here is an example of how to use props along with mutation - this is a good way of summarizing what you are trying to accomplish..
Just change the number in :default-value=X
to simulate passing down a prop..
Full Link:
https://codepen.io/oze4/pen/PLMEab
HTML:
<!-- Main Vue instance (aka parent) -->
<div id="app">
<!-- ----------------------------------------- -->
<!-- CHANGE THE NUMBER 10 TO WHATEVER YOU WANT -->
<!-- ----------------------------------------- -->
<my-counter :default-value=10></my-counter>
</div>
<!-- Child component as x-template component -->
<script type="text/x-template" id="counter">
<div>
<div style="border: 1px solid black; width: 250px; margin: 40px 40px 40px 40px">
<v-btn @click="increase" color="blue">Increase</v-btn>
<v-btn @click="decrease" color="red">Decrease</v-btn>
</div>
<div>
<div>
<h3 style="margin-left: 40px;">Current Count: currentValue </h3>
</div>
</div>
</div>
</script>
JS/Vue
/**
* Child component as x-template
*/
const appCounter =
template: '#counter',
props:
defaultValue:
type: Number,
default: 0
,
data()
return
currentValue: '',
,
mounted()
this.currentValue = this.defaultValue;
,
methods:
increase()
this.currentValue++;
,
decrease()
this.currentValue--;
/**
* Main Vue Instance
*/
new Vue(
el: "#app",
components:
myCounter: appCounter
);
all that matters is to use that value in mounted functin to pass it up yes ??ofc i dont know why i get this error because i have just one component as the vue inspector shows me 2 ofc but i dont send data to secound one
– Farshad
Mar 29 at 6:33
1
You get that error because you are directly modifying a prop. This line:this.total_price = this.extra_price / ( this.newValue - this.base_capacity)
You need to grab the value of that prop and mutate it inside ofdata
.
– Matt Oestreich
Mar 29 at 11:55
add a comment
|
Here is an example of how to use props along with mutation - this is a good way of summarizing what you are trying to accomplish..
Just change the number in :default-value=X
to simulate passing down a prop..
Full Link:
https://codepen.io/oze4/pen/PLMEab
HTML:
<!-- Main Vue instance (aka parent) -->
<div id="app">
<!-- ----------------------------------------- -->
<!-- CHANGE THE NUMBER 10 TO WHATEVER YOU WANT -->
<!-- ----------------------------------------- -->
<my-counter :default-value=10></my-counter>
</div>
<!-- Child component as x-template component -->
<script type="text/x-template" id="counter">
<div>
<div style="border: 1px solid black; width: 250px; margin: 40px 40px 40px 40px">
<v-btn @click="increase" color="blue">Increase</v-btn>
<v-btn @click="decrease" color="red">Decrease</v-btn>
</div>
<div>
<div>
<h3 style="margin-left: 40px;">Current Count: currentValue </h3>
</div>
</div>
</div>
</script>
JS/Vue
/**
* Child component as x-template
*/
const appCounter =
template: '#counter',
props:
defaultValue:
type: Number,
default: 0
,
data()
return
currentValue: '',
,
mounted()
this.currentValue = this.defaultValue;
,
methods:
increase()
this.currentValue++;
,
decrease()
this.currentValue--;
/**
* Main Vue Instance
*/
new Vue(
el: "#app",
components:
myCounter: appCounter
);
all that matters is to use that value in mounted functin to pass it up yes ??ofc i dont know why i get this error because i have just one component as the vue inspector shows me 2 ofc but i dont send data to secound one
– Farshad
Mar 29 at 6:33
1
You get that error because you are directly modifying a prop. This line:this.total_price = this.extra_price / ( this.newValue - this.base_capacity)
You need to grab the value of that prop and mutate it inside ofdata
.
– Matt Oestreich
Mar 29 at 11:55
add a comment
|
Here is an example of how to use props along with mutation - this is a good way of summarizing what you are trying to accomplish..
Just change the number in :default-value=X
to simulate passing down a prop..
Full Link:
https://codepen.io/oze4/pen/PLMEab
HTML:
<!-- Main Vue instance (aka parent) -->
<div id="app">
<!-- ----------------------------------------- -->
<!-- CHANGE THE NUMBER 10 TO WHATEVER YOU WANT -->
<!-- ----------------------------------------- -->
<my-counter :default-value=10></my-counter>
</div>
<!-- Child component as x-template component -->
<script type="text/x-template" id="counter">
<div>
<div style="border: 1px solid black; width: 250px; margin: 40px 40px 40px 40px">
<v-btn @click="increase" color="blue">Increase</v-btn>
<v-btn @click="decrease" color="red">Decrease</v-btn>
</div>
<div>
<div>
<h3 style="margin-left: 40px;">Current Count: currentValue </h3>
</div>
</div>
</div>
</script>
JS/Vue
/**
* Child component as x-template
*/
const appCounter =
template: '#counter',
props:
defaultValue:
type: Number,
default: 0
,
data()
return
currentValue: '',
,
mounted()
this.currentValue = this.defaultValue;
,
methods:
increase()
this.currentValue++;
,
decrease()
this.currentValue--;
/**
* Main Vue Instance
*/
new Vue(
el: "#app",
components:
myCounter: appCounter
);
Here is an example of how to use props along with mutation - this is a good way of summarizing what you are trying to accomplish..
Just change the number in :default-value=X
to simulate passing down a prop..
Full Link:
https://codepen.io/oze4/pen/PLMEab
HTML:
<!-- Main Vue instance (aka parent) -->
<div id="app">
<!-- ----------------------------------------- -->
<!-- CHANGE THE NUMBER 10 TO WHATEVER YOU WANT -->
<!-- ----------------------------------------- -->
<my-counter :default-value=10></my-counter>
</div>
<!-- Child component as x-template component -->
<script type="text/x-template" id="counter">
<div>
<div style="border: 1px solid black; width: 250px; margin: 40px 40px 40px 40px">
<v-btn @click="increase" color="blue">Increase</v-btn>
<v-btn @click="decrease" color="red">Decrease</v-btn>
</div>
<div>
<div>
<h3 style="margin-left: 40px;">Current Count: currentValue </h3>
</div>
</div>
</div>
</script>
JS/Vue
/**
* Child component as x-template
*/
const appCounter =
template: '#counter',
props:
defaultValue:
type: Number,
default: 0
,
data()
return
currentValue: '',
,
mounted()
this.currentValue = this.defaultValue;
,
methods:
increase()
this.currentValue++;
,
decrease()
this.currentValue--;
/**
* Main Vue Instance
*/
new Vue(
el: "#app",
components:
myCounter: appCounter
);
answered Mar 29 at 0:53
Matt OestreichMatt Oestreich
2,1862 gold badges2 silver badges20 bronze badges
2,1862 gold badges2 silver badges20 bronze badges
all that matters is to use that value in mounted functin to pass it up yes ??ofc i dont know why i get this error because i have just one component as the vue inspector shows me 2 ofc but i dont send data to secound one
– Farshad
Mar 29 at 6:33
1
You get that error because you are directly modifying a prop. This line:this.total_price = this.extra_price / ( this.newValue - this.base_capacity)
You need to grab the value of that prop and mutate it inside ofdata
.
– Matt Oestreich
Mar 29 at 11:55
add a comment
|
all that matters is to use that value in mounted functin to pass it up yes ??ofc i dont know why i get this error because i have just one component as the vue inspector shows me 2 ofc but i dont send data to secound one
– Farshad
Mar 29 at 6:33
1
You get that error because you are directly modifying a prop. This line:this.total_price = this.extra_price / ( this.newValue - this.base_capacity)
You need to grab the value of that prop and mutate it inside ofdata
.
– Matt Oestreich
Mar 29 at 11:55
all that matters is to use that value in mounted functin to pass it up yes ??ofc i dont know why i get this error because i have just one component as the vue inspector shows me 2 ofc but i dont send data to secound one
– Farshad
Mar 29 at 6:33
all that matters is to use that value in mounted functin to pass it up yes ??ofc i dont know why i get this error because i have just one component as the vue inspector shows me 2 ofc but i dont send data to secound one
– Farshad
Mar 29 at 6:33
1
1
You get that error because you are directly modifying a prop. This line:
this.total_price = this.extra_price / ( this.newValue - this.base_capacity)
You need to grab the value of that prop and mutate it inside of data
.– Matt Oestreich
Mar 29 at 11:55
You get that error because you are directly modifying a prop. This line:
this.total_price = this.extra_price / ( this.newValue - this.base_capacity)
You need to grab the value of that prop and mutate it inside of data
.– Matt Oestreich
Mar 29 at 11:55
add a comment
|
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55406907%2fvue-warn-avoid-mutating-a-prop-directly-since-the-value-will-be-overwritten-wh%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
What is the name of the component (the name of the
.vue
file)? Try removing thetotal_price: type:Number ,
from theprops
part, keep it only ondata()
. Does it still work?– acdcjunior
Mar 28 at 21:19
2
The warning is clear enough. Just make a copy of
total_price
in thecreated()
function and make changes to that copy.– edwin
Mar 28 at 21:37