1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Tengo un error Vuejs me muestra consola pero en vista -- laravel

Discussion in 'Programming/Internet' started by Wilmer Ramiro Cristancho, Oct 8, 2018.

  1. Template.html

    <div class="container">
    <table class="table table-striped">
    <thead>
    <tr>
    <th scope="col">#</th>
    <th scope="col">Nombre completo</th>
    <th scope="col">Telefono</th>
    <th scope="col">Dirección</th>
    <th scope="col">Pago</th>
    <th scope="col">Opciones</th>
    </tr>
    </thead>
    <tbody>
    <tr v-for="item in orden.data" >
    <th scope="row">{{ item.id}}</th>
    <td>{{item.name}} {{item.last_name}}</td>
    <td>{{item.Celular}}</td>
    <td>{{item.Direccion}}</td>
    <td>{{item.pay}}</td>
    <td> <button type="btn btn-primary" data-toggle="modal" data-target="#exampleModalCenter" v-on:click="showgetcompra(item)">Reporte</button></td>
    </tr>
    </tbody>
    </table>


    Modal

    <div class="modal fade" id="exampleModalCenter" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered" role="document">
    <div class="modal-content">
    <div class="modal-header">
    <h5 class="modal-title" id="exampleModalCenterTitle">Modal title</h5>
    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
    <span aria-hidden="true">&times;</span>
    </button>
    </div>
    <div class="modal-body">

    <div v-for="items in vercompra.data">
    <h1>hola {{items.Orden["0"].Img_Produ}}</h1>
    </div>
    </div>
    <div class="modal-footer">
    <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
    <button type="button" class="btn btn-primary">Save changes</button>
    </div>
    </div>
    </div>
    </div>
    <pagination data="orden" @pagination -change-page="fetchData"></pagination>


    Script.JS

    <script>
    export default {
    mounted() {
    this.fetchData(),
    this.showgetcompra(),
    this.timer = setInterval(

    this.fetchData, 10000)
    console.log(this.timer)
    },
    data ( ){
    return {
    orden: [],
    vercompra:[],
    timer: '',
    loading: false

    }
    },
    methods:{

    fetchData(page){

    if (typeof page === 'undefined') {
    page = 1;
    }

    axios.get('/api/cart?page='+page)
    .then((res)=>{

    this.orden = res.data
    console.log(res.data)
    })
    .catch((err)=>{
    console.log(err)
    })
    },
    cancelAutoUpdate: function() {
    clearInterval(this.timer)
    },

    beforeDestroy() {
    clearInterval(this.timer)
    },

    showgetcompra: function(item){

    axios.get('/api/cart/'+item.id)
    .then((res)=>{

    this.vercompra = res.data
    console.log(res.data)
    })
    .catch((err)=>{
    console.log(err)
    })
    },
    eliminarcompras(){

    }

    }

    }
    </script>


    [​IMG]

    Login To add answer/comment
     

Share This Page