Giter Club home page Giter Club logo

laravel-scout-and-vuejs's People

Contributors

rashidlaasri avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

laravel-scout-and-vuejs's Issues

don't work when move vue code to assets

it works fine, but since in this example you don't use assets it is still working like standalone solution.

if I move vue code from standalone app.js to the end of my resources\assets\js\app.js and compile it using gulp then it doesn't work anymore

const app = new Vue({

    el: 'body',

    data: {
        furnitura: [],
        loading: false,
        error: false,
        query: ''
    },

    methods: {
        search: function() {
            // Clear the error message.
            this.error = '';
            // Empty the furnitura array so we can fill it with the new furnitura.
            this.furnitura = [];
            // Set the loading property to true, this will display the "Searching..." button.
            this.loading = true;

            // Making a get request to our API and passing the query to it.
            this.$http.get('/api/search?q=' + this.query).then((response) => {
                // If there was an error set the error message, if not fill the furnitura array.
                response.body.error ? this.error = response.body.error : this.furnitura = response.body;
                // The request is finished, change the loading to false again.
                this.loading = false;
                // Clear the query.
                this.query = '';
            });
        }
    }

});

instead it gives me error in console

ReferenceError: Laravel is not defined
Стек-трейс:
@http://scout/js/app.js line 72 > eval:30:3
exec@http://scout/js/app.js line 116 > eval:1017:21
Client/<@http://scout/js/app.js line 116 > eval:1045:13
Promise$1@http://scout/js/app.js line 116 > eval:192:24
Client@http://scout/js/app.js line 116 > eval:1010:16
Http@http://scout/js/app.js line 116 > eval:1152:12
Http[method]@http://scout/js/app.js line 116 > eval:1181:16
search@http://scout/js/app.js line 148 > eval:42:4
bind/<@http://scout/js/app.js line 123 > eval:216:69
anonymous@http://scout/js/app.js line 123 > eval line 3041 > Function:1:9
handler@http://scout/js/app.js line 123 > eval:8652:7
app.js%20line%20116%20%3E%20eval:270:9

ReferenceError: Laravel is not defined[Подробнее]app.js%20line%2072%20%3E%20eval:30:3

here is screenshot
https://yadi.sk/i/-iqfuUgLwu9wE

then I commented this code in bootstrap.js

Vue.http.interceptors.push((request, next) => {
    request.headers['X-CSRF-TOKEN'] = Laravel.csrfToken;

    next();
});

and now I have infinite quantity of search results and a lot of console errors dublicate value found
here is screenshot
https://yadi.sk/i/5LSu3WGcwu9tT

JSON.parse(this.response)

Hi.
I worked through the tutorial, but in the result of the search function I had to write JSON.parse
The JSON object from Algolia came as a string.
Maybe I missed something.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.