Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var portal = new Vue({
- el: "#AnnounceController",
- data: {
- ann: {
- id: '',
- content: ''
- },
- announces: [],
- success: false,
- edit: false
- },
- methods: {
- fetchAnnounce: function () {
- axios.get('/api/announces')
- .then(function (response) {
- this.announces = response.data;
- console.log(this.announces);
- })
- .catch(function (error) {
- console.log(error);
- });
- }
- },
- computed: {},
- mounted: function () {
- console.log('mounted')
- this.fetchAnnounce()
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement