importing components in standalone configuration not working..



  • Hello i am trying to import an exportFile component like this in a standalone quasar configuration on my existing project but it does not work…

    
    <script src="https://cdn.jsdelivr.net/npm/vue@^2.0.0/dist/vue.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/quasar@1.12.2/dist/quasar.umd.min.js"></script>
    
    <script>
    import { exportFile } from 'quasar';
    
    function wrapCsvValue (val, formatFn) {
      let formatted = formatFn !== void 0
        ? formatFn(val)
        : val
    
      formatted = formatted === void 0 || formatted === null
        ? ''
        : String(formatted)
    
      formatted = formatted.split('"').join('""')
      /**
       * Excel accepts \n and \r in strings, but some other CSV parsers do not
       * Uncomment the next two lines to escape new lines
       */
      // .split('\n').join('\\n')
      // .split('\r').join('\\r')
    
      return `"${formatted}"`
    }
    
    new Vue({
    el: '#q-app',
    data: function () {
    return { 
        loading: false,
        filter: "",
        arrData: [],
    

    Can somebody please advise the right way to do it as i could not find it in the docs…

    Thanks
    gs



  • i have now figured out you need to import like this Quasar.utils.exportFile

    import { exportFile } from Quasar.utils.exportFile;
    
    

    might help someone who have this issue…


Log in to reply