Bagisto Forum

    Bagisto

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    How to set base path in mounted function in vue js ?

    General Discussion
    2
    2
    289
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • _
      _developer_12 last edited by

      How to set base path in mounted function in vue js ?

      My code : -

      mounted () {
      if(this.image.id && this.image.url) {
      console.log(this.image);
      this.imageData ='http://localhost/bagisto/storage/app/public/'+this.image.path;
      }
      },

      i want to set dynamic url. i had tried "{{url()->to('/')}".....but its now working.Please tell me that how can i set dynamic url ?

      Thanks

      1 Reply Last reply Reply Quote 0
      • shubhwebkul
        shubhwebkul last edited by

        There can be two options, either you can set path in window object and fetch in mounted method or you could pass attribute in script tag.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post