My code is like this :
<script>
export default{
props:... ,
data(){
return{
...
}
},
computed:{
...
},
methods:{
filterBySort: function (sort){
...
},
filterByLocation: function (location){
...
}
}
}
</script>
For example, parameter sort = lowest (on the filterBySort method)
I want display value of parameter sort on the filterByLocation
How can I do it?
如果你定义变量sort
中的数据,并更改它filterBySort
方法是这样的: this.sort = lowest
,相同的值将在可用的方法filterByLocation
为好。
One of the ways is to set it up in the data properties.
<script>
export default{
props:... ,
data() {
return{
sort: null,
location: null
}
},
computed:{
...
},
methods:{
filterBySort: function (){
console.log(this.sort)
},
filterByLocation: function (){
console.log(this.location)
}
}
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.