Evan You 10 лет назад
Родитель
Сommit
04df2c0f7d
1 измененных файлов с 4 добавлено и 6 удалено
  1. 4 6
      examples/select2/index.html

+ 4 - 6
examples/select2/index.html

@@ -25,16 +25,14 @@
     <script>
     <script>
     Vue.directive('select', {
     Vue.directive('select', {
       twoWay: true,
       twoWay: true,
+
+      params: ['options'],
+
       bind: function () {
       bind: function () {
-        var optionsData
-        var optionsExpression = this.param('options')
-        if (optionsExpression) {
-          optionsData = this.vm.$eval(optionsExpression)
-        }
         var self = this
         var self = this
         $(this.el)
         $(this.el)
           .select2({
           .select2({
-            data: optionsData
+            data: this.params.options
           })
           })
           .on('change', function () {
           .on('change', function () {
             self.set(this.value)
             self.set(this.value)