--> <div id="app"> <div> <input type="radio" name="view1" value="view1" v-model="view"> <input type="radio" name="view2" value="view2" v-model="view"> </div> <p>current view : <view>view1</view></p> <div> # element directive ͷҾͷ༰ <p>name: {{name}}</p> <p>arg: {{arg}}</p> <p>expression: {{expression}}</p> <p>raw: {{raw}}</p> </div> </div> new Vue({ data: { view: ‘view1' }, elementDirectives: { view: { bind: function () { var self = this this.vm.$set('arg', this.arg) // undefined this.vm.$set('expression', this.expression) // “” this.vm.$set('raw', this.raw) // “” this.vm.$set('name', this.name) // view this._watcher = this.vm.$watch('view', function (val, old) { self.update(val, old) }) }, ...