File tree Expand file tree Collapse file tree 4 files changed +17
-7
lines changed Expand file tree Collapse file tree 4 files changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -395,7 +395,17 @@ computed: {
395395
396396 This option indicates the directive is two-way and may write back to the model. Allows the use of `this.set(value)` inside directive functions.
397397
398- - #### Removed directive option: `isEmpty`
398+ - #### New directive option: `acceptStatement`
399+
400+ This option indicates the directive accepts inline statements like `v-on` does:
401+
402+ ``` html
403+ <a v-on="click: a++"></a>
404+ ```
405+
406+ The statement will be wrapped up as a function and passed as the argument to the directive' s ` update` function .
407+
408+ - #### Removed directive option: `isEmpty`, `isFn`
399409
400410## Interpolation change
401411
Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ p._bind = function (def) {
6363 if (
6464 this . update && this . _watcherExp &&
6565 ( ! this . isLiteral || this . _isDynamicLiteral ) &&
66- ! this . _checkExpFn ( )
66+ ! this . _checkStatement ( )
6767 ) {
6868 // use raw expression as identifier because filters
6969 // make them different watchers
@@ -122,10 +122,10 @@ p._checkDynamicLiteral = function () {
122122 * @return {Boolean }
123123 */
124124
125- p . _checkExpFn = function ( ) {
125+ p . _checkStatement = function ( ) {
126126 var expression = this . expression
127127 if (
128- expression && this . isFn &&
128+ expression && this . acceptStatement &&
129129 ! expParser . pathTestRE . test ( expression )
130130 ) {
131131 var fn = expParser . parse ( expression ) . get
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ var _ = require('../util')
22
33module . exports = {
44
5- isFn : true ,
5+ acceptStatement : true ,
66 priority : 700 ,
77
88 bind : function ( ) {
Original file line number Diff line number Diff line change @@ -97,8 +97,8 @@ describe('Directive', function () {
9797 } )
9898 } )
9999
100- it ( 'expression function ' , function ( ) {
101- def . isFn = true
100+ it ( 'inline statement ' , function ( ) {
101+ def . acceptStatement = true
102102 var spy = jasmine . createSpy ( )
103103 vm . $options . filters . test = function ( fn ) {
104104 spy ( )
You can’t perform that action at this time.
0 commit comments