vuejs / vue Goto Github PK
View Code? Open in Web Editor NEWThis is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core
Home Page: http://v2.vuejs.org
License: MIT License
This is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core
Home Page: http://v2.vuejs.org
License: MIT License
Use CasperJS (see travis integration from ghost)
template should simply be a string. the VM constructor makes real nodes out of it and then cache it for future instantiation, because cloneNode() is faster than innerHTML. So - remove util.collectTemplates() and let the users handle where/how to store templates. This also allows better capsulation for component distribution.
sd-pre
should just wrap existing hook
Instead of changing the global/default prefix, allow users to create namespaced directives with their own prefixes.
see TODO in src.
Define a custom element!
Pass in a simple function:
Seed.element('tabs', function (el) {
// ...
})
Or pass in a Seed viewmodel constructor / option object:
Seed.element('tabs', {
tagName: 'ul',
replace: true,
template: '...',
init: function () {
// ...
}
})
e.g.
ok ? yesMsg : noMsg
With the current deps tracking, because of the short-circuiting of the ternary expression, if ok
is true
then only yesMsg
gets tracked and we will miss noMsg
.
access everything with a var
statement...
sd-transition
comes in two flavors:
Use sd-transition-class
. e.g:
<div class="test" sd-transition-class="fade">
.test {
transition: opacity .5s linear;
}
.test.fade {
opacity: 0;
}
Use sd-transition
and define them like this:
<div class="test" sd-transition="fade">
Seed.transition('fade', {
enter: function (el, attach) {
// ...
attach()
},
leave: function (el, detach) {
// ...
detach()
}
})
Transitions are triggered during append/remove operations of the following directives:
sd-if
sd-repeat
(leave via vm.$destroy()
)sd-show
General procedure:
Is contextual bindings really needed any more now that we have expression bindings?
It looks unused in current implementation.
e.g. {{ a.b + a.c }}
doesn't catch any dependencies
__observer__
and propagate the events up.Currently over 20 tests fail in IE9.
This should probably be a separate module / extension / plugin / whatever
Should also remove these extra listeners in unbind()
This should indicate whether to replace the VM root node being compiled with the template. Only works if the template has only one node.
provide these methods for nested VMs to communicate with each other (Angular style): $on
, $off
, $broadcast
, $emit
batch.js
Pseudo code
Rip out the default filters into a separate module. Basic case transforms can be done with CSS since we are IE9+; More complicated filters are better customized anyway.
v-component="component-name[:object-to-bind-as-model]"
This should be a separate module.
This should be a separate module.
should be able to include partial templates...
Like this:
<div sd-partial="#temp"></div>
Or like this:
{{>#temp}}
Convenience methods for VMs created off-DOM; also applies transitions automatically.
simply a function to be called during vm.$destroy
.
RESTful sync for seed as a separate module
When an object is observed by many anonymous expression bindings (>100) the new ViewModel instantiation gets increasingly slow. Currently has no idea why - but it has something to do with the exp parser / anon directive thing. Need to do more profiling.
options:
seed-router
as a separate moduleThis probably should be a separate module.
Potential XSS vulnerability
new
something, it should always look the same) If you want the same logic but a different template, you should extend it as a new VM constructor. Therefore, no more sd-template
sd-partial
.seed.vm('id', VM)
so it can be used inline via sd-vm
, id should be no longer an init option.seed.partial('id', 'partial')
seed.ViewModel.extend
Tentative
How can we allow access to nested component VMs in code, while allowing declarative compositing in markup?
Currently I'm torn on how the final API should look like. There are three main references: Angular, Backbone & Ractive.
Angular
Markup everything, define everything, bootstrap() once
Declarative
Backbone
Creates .el
if not exist using options like tagName, properties, etc...
Ractive
Takes a string template, also allows inline by treating it as an ID if it starts with '#'
This is a far reach, God knows when will I get to these.
use sd-id
to be able to reference a child Seed from a parent Seed.
Example:
<div id="parent">
<div sd-id="child" sd-viewmodel="abc"></div>
</div>
var parent = new Seed({ el: '#parent' })
// a node with `sd-viewmodel` and `sd-id` both present will
// have its corresponding VM instance registered under parent VM's "$" property
var child = parent.$.child
Basically a component can be distributed alone with an extended VM constructor and a template string. So globally there needs to be a method that registers these VMs to a unique id so they can be nested in other views.
sd-model
lazy
optione.g. different types of <input>
:
and <select>
e.g. <div sd-editbox></div>
Seed.directive('editbox', {
bind: function () {
// ...
},
unbind: function () {
// ...
}
})
sd-each
to sd-repeat
data
option to scope
props
option to proto
_
should also be ignored and used as a convention: $
is library properties, _
is user properties and non-prefixed properties are data.A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.