x-spreadsheet ./node_modules/x-data-spreadsheet/src/index.less:1:5 - Error: Module parse failed: Unexpected token (1:5) angular 15

pgpifvop  于 5个月前  发布在  Angular
关注(0)|答案(4)|浏览(75)

./node_modules/x-data-spreadsheet/src/index.less:1:5 - Error: Module parse failed: Unexpected token (1:5)
File was processed with these loaders:

  • ./node_modules/less-loader/dist/cjs.js
    You may need an additional loader to handle the result of these loaders.
    body {
    | margin: 0;
    | }

any solution ?

xurqigkl

xurqigkl1#

@yesusagayarajs I have the same issue, did you find the solution?
thank you.

zlhcx6iw

zlhcx6iw2#

I made it empty for index.less file . now it is working .

t2a7ltrp

t2a7ltrp3#

Thank you , it is working now

2jcobegt

2jcobegt4#

Hi @IbrahimAlhaj9 Please add your header section text display name and value as tablefieldname.
"rows": {
"0": {
"cells": {

"0": {
        "text": "Asunto",
        "value": "subject",
        "style": 10,
        "editable": false,
		      "required":true,
        "type":"text"
      },
      "1": {
        "text": "type",
        "value": "typ",
        "style": 10,
        "editable": false,
		      "required":true,
        "type":"picklist"
      },
      
  }
  }
  
  
}

this.spreadsheetData = new Spreadsheet("#testSheet", {
    mode: "edit",
    //showToolbar: true,
    showGrid: true,
    //showContextmenu: true,
    view: {
      height: function () {
        return 400;
      },
      width: function () {
        return 1200;
      }
    },
    row: { len: 10, height: 25 },
    col: {
      len: 4,
      width: 100,
      indexWidth: 60,
      minWidth: 60
    }
  })
    .loadData(this.testSheetData)
    .change((data) => {
      
      this.onchangeData(data)// onchange function 
    });
    //console.log(mySpreadSheet.validate());

    this.spreadsheetData.on('cell-edited', (cell, ri, ci) => {
      console.log('cell:', cell, ', ri:', ri, ', ci:', ci);
    })
    
    //You will map the based the row values
    let header = rows[0]['cells'];
    for(let index in header) {
              let fieldName = header[index].value;
              let val='';
              if(resRe[fieldName]!=undefined) {
                if (typeof resRe[fieldName] === 'string' || resRe[fieldName] instanceof String) {
                  val=resRe[fieldName];
                  fieldValue[index]={'text':val,'id':rec};
                }else {
                  if(fieldName=='ref_product') {
                    if(resRe[fieldName].length>0) {
                      val = resRe[fieldName][0].label;
                    }
                    
                  }else {
                    val=resRe[fieldName].label;
                  }
                  

                  fieldValue[index]={'text':val,'id':rec};
                }
              }else {
                fieldValue[index]={'text':val,'id':rec};
              }
            }

相关问题