wuyuedefeng / blogs

博客文章在issue中
5 stars 0 forks source link

electron-vue 杂记 #3

Open wuyuedefeng opened 5 years ago

wuyuedefeng commented 5 years ago

配置 scss 全局变量

{
  test: /\.scss$/,
  // use: ['vue-style-loader', 'css-loader', 'sass-loader']
  use: ['vue-style-loader', 'css-loader', 'sass-loader', {
    loader: 'sass-resources-loader',
    options: {
      resources: [
        // path.resolve(__dirname, '../src/renderer/assets/stylesheets/mixins/*.scss')
        path.resolve(__dirname, '../src/renderer/assets/stylesheets/mixins/_variables.scss')
      ]
    }
  }]
},

打开外部链接

export default {
methods: {
open (link) {
this.$electron.shell.openExternal(link)
}
},
mounted () {
this.open('https://www.baidu.com')
}
}
wuyuedefeng commented 3 years ago

asar代码压缩

# 安装asar
npm install asar -g
# 压缩
asar pack ./app app.asar
# 解压缩
asar extract ./app.asar ./app