Created
August 1, 2020 14:42
-
-
Save PKTseng/29a899ad8f2be22a54cbff811c1eb3ab to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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