Integrate jQuery into a electron app

后端 未结 3 1415
臣服心动
臣服心动 2021-02-09 16:41

I\'m trying to add jquery functionality to a desktop app written in electron Using the electron-quick-start repo i\'m adding the downloaded jquery file to the main.html

3条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-09 17:36

    To integrate jQuery into your Electron Application follow these simple steps

    Step 1: Run in terminal

    npm install jquery --save
    

    Step 2: Add this line to your angular.json or angular-cli.json file

     "build": {
            "options": {
                "styles": [
                  "node_modules/bootstrap/dist/css/bootstrap.min.css",
                  "src/styles.css"
                ],
                "scripts": [
                  "node_modules/jquery/dist/jquery.js", //add this line
                  "node_modules/bootstrap/dist/js/bootstrap.min.js"
                ],
    ...
    ...
         }
      }
    

    Step 3: Finally add this line to your index.html file

     
      
      
    
      
      
    
    

    You can also use this template

提交回复
热议问题