@seedalpha/vue-engine
v2.18.14
Published
Reactive web application framework
Downloads
2
Readme
vue-engine
Reactive web application framework
Changelog
2.18.1
:
- emit connecting events to vue app
2.18.0
:
- use talker for communication
2.17.1
:
- use private npm
2.16.0
:
- use patched vuejs
[email protected]
2.15.2
:
- update to
[email protected]
2.15.1
:
- update to
[email protected]
2.15.0
:
- update to
[email protected]
2.14.1
:
- do not override the data in view on
render
, but just extend
2.14.0
:
- update to [email protected]
2.13.2
:
- include
cursors
inprops
during init
2.13.1
:
- add mixins to top-level app
2.13.0
:
- inject
seed-store
intoapp
2.12.0
:
- include
seed-store
- inject
seed-store
to components throughmixins
2.11.0
:
- add
mixins
option - extend components with
mixins
2.10.1
:
- update template to reference latest version
2.10.0
:
- expose client emitter
2.9.0
:
- remove dispatch method
- refactor emit to have emit from root VM
2.8.0
:
- add emitter method dispatch
2.7.1
:
- update
seed-router
2.7.0
:
- make
route
andve
events compatible with new vue event model
2.6.0
:
- application redirect method
- include helpers into bundle
2.5.0
:
- let app/ctx
redirect
rewrite urls
2.4.0
:
- app-wide getters and setters (convenience)
2.3.0
:
- update template to use
seedalpha/gulp-connect
- update template tasks to support socket connections
2.2.1
:
- update
template/package.json
to refer to the latest version ofvue-engine
2.2.0
:
- use observers to track view events
2.1.1
:
- remove hardcoded paths
2.1.0
:
- use gulp-sass to process scss
2.0.1
:
- cli output vue-engine
version
- prefix hash routes
- remove unused dependencies
2.0.0
:
- update template
- update project dependencies
1.0.0
:
- Initial release
Installation
$ npm install -g vue-engine
Usage
$ ve [project_name]
$ cd [project_name]
$ npm install
$ npm start
API
// client.js
var VueEngine = require('vue-engine');
var bundle = require('./bundle');
var store = {};
var app = new VueEngine({
name: 'user',
handshake: {
token: document.body.getAttribute('token')
},
el: '#root',
template: require('./layout.html'),
bundle: bundle,
data: {
user: 'john'
},
mixins: [{
computed: {
store: function() {
return store;
}
}
}],
config: {}
});
var router = app.router();
router.add('/', function(ctx) {
ctx
.title('Home Page')
.render('home', {
user: ctx.get('user')
});
});
router.add('/posts', bundle.controllers.postsCtrl);
app.start();
// server.js
var http = require('http');
var Driver = require('seed-driver');
var DRTP = require('driver-rtp');
var server = http.createServer();
var driver = new Driver('user');
driver.use(function(context) {
context.client = context.locals.client;
context.session = context.locals.client.handshake;
context.token = context.session.token;
context.next();
});
driver.use(function(context) {
UserToken.findOne({ token: context.token }, function(err, token) {
if (err || !token) return context.error('not authenticated');
User.findById(token.user, function(err, user) {
if (err || !user) return context.error('not authenticated');
context.user = user;
context.next();
});
});
});
driver.define('getProfile', function(context) {
var profile = context.user.toJSON();
delete profile.password;
delete profile.hash;
delete profile.salt;
context.result(profile);
});
var drtp = new DRTP(driver);
drtp.install(server);
server.listen(5000);
Development
$ git clone [email protected]:seedalpha/vue-engine.git
$ cd vue-engine
$ npm install
$ npm test
Author
Vladimir Popov [email protected]
License
©2014 Seedalpha