Skip to content

Instantly share code, notes, and snippets.

@PKTseng

PKTseng/index.js

Created Aug 1, 2020
Embed
What would you like to do?
var app = new Vue({
el:"#app",
data:{
arrayData: [
{
name: '小明',
age: 16
},
{
name: '漂亮阿姨',
age: 24
},
{
name: '杰倫',
age: 20
}
],
//將陣列做反轉
methods: {
reverseArray: function () {
this.arrayData.reverse()
console.log(this.arrayData)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.