Electron-vue+ts構築プロジェクト


## 1.   electron-vue  :
    ```js
            vue/cli: npm install -g @vue/cli
            my-project:vue init simulatedgreg/electron-vue my-project
            my-project:cd my-project
             :npm install
            :npm run dev 
            :npm run test

        electron-vue  Ts  :https://blog.csdn.net/weixin_44872699/article/details/108976677
    ```

## 2. electron-vue    : process is not defined, webpack.renderer.config.js webpack.web.config.js       HtmlWebpackPlugin            :
    ```js
        new HtmlWebpackPlugin({
            ......
            templateParameters(compilation, assets, options) {
                return {
                    compilation: compilation,
                    webpack: compilation.getStats().toJson(),
                    webpackConfig: compilation.options,
                    htmlWebpackPlugin: {
                        files: assets,
                        options: options
                    },
                    process
                }
            }
        })    
    ```

## 3. Vue+ts  this.$store  :    :(this as any).$store 

## 4. vue-electron     vuex   ,       :https://segmentfault.com/a/1190000018038529?utm_source=tag-newest
    ```js
        1.   renderer/store/index.js  createSharedMutations  
        2.       :import '../renderer/store'
    ```
## 5.     /    :
    ```css
        .drag{
            -webkit-app-region: drag;
        }
        .no-drag{
            -webkit-app-region: no-drag;
        }
    ```
## 6. TypeScript       ,         :  :https://www.cnblogs.com/xym4869/p/13323483.html   https://www.jianshu.com/p/35742227738e
    ```txt
        6.1              TypeScript   (    ts     ),             @types/。          ,         ,            TypeScript    
             : npm install @types/XXX
        6.2 src/@types/,  src     @types  ,     .d.ts    ,          ,                         。
             : declare module 'XXX' {
                    const content: any
                    export = content
                }
    ```

## 7.   this as any       ,    :
    ```js
        new Promise((resolve,reject)=>{
            (this as any).newFriendList.splice(index,1)
            resolve('ok')
        }).then(()=>{
            (this as any).$store.commit('SET_ADD_FRIEND_LIST',item)
        })
    ```