Skip to content

Commit 04df2c0

Browse files
committed
update select2 example
1 parent 50cf2ab commit 04df2c0

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

examples/select2/index.html

+4-6
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,14 @@
2525
<script>
2626
Vue.directive('select', {
2727
twoWay: true,
28+
29+
params: ['options'],
30+
2831
bind: function () {
29-
var optionsData
30-
var optionsExpression = this.param('options')
31-
if (optionsExpression) {
32-
optionsData = this.vm.$eval(optionsExpression)
33-
}
3432
var self = this
3533
$(this.el)
3634
.select2({
37-
data: optionsData
35+
data: this.params.options
3836
})
3937
.on('change', function () {
4038
self.set(this.value)

0 commit comments

Comments
 (0)