add hello-word demo (#6)
This commit is contained in:
parent
879c3367b0
commit
1523a8d7c2
2 changed files with 52 additions and 0 deletions
16
demo/app.js
Normal file
16
demo/app.js
Normal file
|
@ -0,0 +1,16 @@
|
|||
const electron = require('electron');
|
||||
const app = electron.app;
|
||||
|
||||
app.setName('electron-tabs-demo');
|
||||
|
||||
|
||||
app.on('ready', function () {
|
||||
|
||||
const mainWindow = new electron.BrowserWindow();
|
||||
mainWindow.loadURL('file://' + __dirname + '/electron-tabs.html');
|
||||
mainWindow.on('ready-to-show', function () {
|
||||
mainWindow.show();
|
||||
mainWindow.focus();
|
||||
});
|
||||
|
||||
});
|
36
demo/electron-tabs.html
Normal file
36
demo/electron-tabs.html
Normal file
|
@ -0,0 +1,36 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<link rel="stylesheet" href="../electron-tabs.css">
|
||||
</head>
|
||||
<body style="margin:0">
|
||||
|
||||
<div class="etabs-tabgroup">
|
||||
<div class="etabs-tabs"></div>
|
||||
<div class="etabs-buttons"></div>
|
||||
</div>
|
||||
<div class="etabs-views"></div>
|
||||
|
||||
|
||||
<script>
|
||||
//const TabGroup = require('electron-tabs') normally but for demo :
|
||||
const TabGroup = require("../index");
|
||||
|
||||
let tabGroup = new TabGroup();
|
||||
|
||||
tabGroup.addTab({
|
||||
title: 'Google',
|
||||
src: 'http://google.com',
|
||||
});
|
||||
|
||||
tabGroup.addTab({
|
||||
title: "Electron",
|
||||
src: "http://electron.atom.io",
|
||||
visible: true,
|
||||
active: true
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in a new issue