1234567891011121314151617181920212223242526272829303132333435363738 |
- <div id="{$name}">
- <input type="hidden" name="{$name}" v-model="value">
- {if $disabled==0}
- <el-select clearable filterable v-model="value" placeholder="请选择">
- <el-option
- v-for="item in options"
- :key="item.id"
- :label="item.title"
- :value="item.id.toString()">
- </el-option>
- </el-select>
- {else}
- <el-select clearable filterable disabled v-model="value" placeholder="请选择">
- <el-option
- v-for="item in options"
- :key="item.id"
- :label="item.title"
- :value="item.id.toString()">
- </el-option>
- </el-select>
- {/if}
- </div>
- <script>
- new Vue({
- el: '#{$name}',
- data: function() {
- return {
- options: {:json_encode($lists)},
- value:"{$val==0?'':$val}"
- }
- },
- watch: {
- value: function (newVal, oldVal) {
- $('input[name={$name}').val(newVal);
- }
- }
- })
- </script>
|